SignatureScheme

Trait SignatureScheme 

Source
pub trait SignatureScheme {
    // Required methods
    fn sign<Rng: CryptoRngCore>(
        self,
        rng: Option<&mut Rng>,
        priv_key: &RsaPrivateKey,
        hashed: &[u8],
    ) -> Result<Vec<u8>>;
    fn verify(
        self,
        pub_key: &RsaPublicKey,
        hashed: &[u8],
        sig: &[u8],
    ) -> Result<()>;
}
Expand description

Digital signature scheme.

Required Methods§

Source

fn sign<Rng: CryptoRngCore>( self, rng: Option<&mut Rng>, priv_key: &RsaPrivateKey, hashed: &[u8], ) -> Result<Vec<u8>>

Sign the given digest.

Source

fn verify(self, pub_key: &RsaPublicKey, hashed: &[u8], sig: &[u8]) -> Result<()>

Verify a signed message.

hashed must be the result of hashing the input using the hashing function passed in through hash.

If the message is valid Ok(()) is returned, otherwise an Err indicating failure.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§