Trait rsa::SignatureScheme

source ·
pub trait SignatureScheme {
    fn sign<Rng: CryptoRngCore, Priv: PrivateKey>(
        self,
        rng: Option<&mut Rng>,
        priv_key: &Priv,
        hashed: &[u8]
    ) -> Result<Vec<u8>>; fn verify<Pub: PublicKey>(
        self,
        pub_key: &Pub,
        hashed: &[u8],
        sig: &[u8]
    ) -> Result<()>; }
Expand description

Digital signature scheme.

Required Methods§

Sign the given digest.

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.

Implementors§