Trait Verifier

Source
pub trait Verifier:
    Specification
    + Clone
    + Send
    + Sync
    + 'static {
    // Required method
    fn verify(
        namespace: Option<&[u8]>,
        message: &[u8],
        public_key: &Self::PublicKey,
        signature: &Self::Signature,
    ) -> bool;
}
Expand description

Implementation that can verify that a PublicKey produced a valid Signature.

Required Methods§

Source

fn verify( namespace: Option<&[u8]>, message: &[u8], public_key: &Self::PublicKey, signature: &Self::Signature, ) -> bool

Check that a signature is valid for the given message and public key.

The message should not be hashed prior to calling this function. If a particular scheme requires a payload to be hashed before it is signed, it will be done internally.

Because namespace is prepended to message before signing, the namespace provided here must match the namespace provided during signing.

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§