Skip to main content

SignatureVerifier

Trait SignatureVerifier 

Source
pub trait SignatureVerifier:
    Send
    + Sync
    + Debug {
    // Required method
    fn verify_signature(
        &self,
        algorithm: &AlgorithmIdentifier<'_>,
        public_key: &SubjectPublicKeyInfo<'_>,
        message: &[u8],
        signature: &[u8],
    ) -> Result<(), CryptoError>;
}
Expand description

Checks one signature over one message, given the signer’s SPKI and the algorithm the signature was made with.

This is the whole contract between the chain-building core and a crypto library: implement it and any backend drops in, whether or not its keys can be usefully prepared ahead of the message. Backends that do have a reusable key type build one inside verify_signature; those that carry per-algorithm state (an OpenSSL digest, a PSS flag) simply keep it in local variables rather than in a struct that outlives the call.

Required Methods§

Source

fn verify_signature( &self, algorithm: &AlgorithmIdentifier<'_>, public_key: &SubjectPublicKeyInfo<'_>, message: &[u8], signature: &[u8], ) -> Result<(), CryptoError>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§