pub trait Verifier:
Send
+ Sync
+ Debug {
// Required method
fn verify(&self, key_id: &str, hash: &Digest, signature: &[u8]) -> bool;
}Expand description
Checks a signature against the key that claims to have made it.
Deliberately separate from Signer: an auditor verifies without being able
to sign, and that asymmetry is the entire point of using signatures rather
than a MAC. A verifier that could also sign would be a shared secret with
extra steps.
Required Methods§
Sourcefn verify(&self, key_id: &str, hash: &Digest, signature: &[u8]) -> bool
fn verify(&self, key_id: &str, hash: &Digest, signature: &[u8]) -> bool
Whether signature over hash was made by key_id.
Returns false for an unknown key rather than erroring: an unknown
signer and a bad signature are the same answer to the only question
being asked, which is may I believe this record.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".