Trait Sign

Source
pub trait Sign {
    type Error;

    // Required methods
    fn sign<'data, K: AsKey>(
        data: &'data str,
        key: &K,
        algorithm: Algorithm,
    ) -> Result<BindSignature<'data>, Self::Error>;
    fn verify<K: AsKey>(
        signature: BindSignature<'_>,
        data: &str,
        key: &K,
    ) -> Result<bool, Self::Error>;
}
Expand description

Sign something and verify signature

Required Associated Types§

Source

type Error

Error Result

Required Methods§

Source

fn sign<'data, K: AsKey>( data: &'data str, key: &K, algorithm: Algorithm, ) -> Result<BindSignature<'data>, Self::Error>

Sign something

Source

fn verify<K: AsKey>( signature: BindSignature<'_>, data: &str, key: &K, ) -> Result<bool, Self::Error>

Verify signature

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§