pub trait Signer: Send + Sync {
// Required methods
fn algorithm(&self) -> &'static str;
fn public_key(&self) -> &[u8] ⓘ;
fn sign(&self, data: &[u8]) -> Result<Vec<u8>, SignerError>;
fn verify(&self, data: &[u8], signature: &[u8]) -> Result<(), SignerError>;
}Expand description
Trait for cryptographic signers.
Required Methods§
fn algorithm(&self) -> &'static str
fn public_key(&self) -> &[u8] ⓘ
fn sign(&self, data: &[u8]) -> Result<Vec<u8>, SignerError>
fn verify(&self, data: &[u8], signature: &[u8]) -> Result<(), SignerError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".