Skip to main content

Signer

Trait Signer 

Source
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§

Source

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

Source

fn public_key(&self) -> &[u8]

Source

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

Source

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".

Implementors§