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§
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>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".