Skip to main content

SigningMethod

Trait SigningMethod 

Source
pub trait SigningMethod: Send + Sync {
    // Required methods
    fn alg(&self) -> &'static str;
    fn sign(
        &self,
        data: &[u8],
        key: &Key,
    ) -> Result<Vec<u8>, SigningMethodError>;
    fn verify(
        &self,
        data: &[u8],
        signature: &[u8],
        key: &Key,
    ) -> Result<(), SigningMethodError>;
}
Expand description

SigningMethod signs and verifies PWT payloads.

Required Methods§

Source

fn alg(&self) -> &'static str

Source

fn sign(&self, data: &[u8], key: &Key) -> Result<Vec<u8>, SigningMethodError>

Source

fn verify( &self, data: &[u8], signature: &[u8], key: &Key, ) -> Result<(), SigningMethodError>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§