Verifier

Trait Verifier 

Source
pub trait Verifier<S>
where S: Signature,
{ // Required method fn verify(&self, msg: &[u8], signature: &S) -> Result<(), Error>; }
Expand description

Implemented by Keypair and PublicKey to cryptographically Verifier::verify arbitrary bytesequences. Verify the provided message bytestring using Self (e.g. a public key)

Required Methods§

Source

fn verify(&self, msg: &[u8], signature: &S) -> Result<(), Error>

Use Self to verify that the provided signature for a given message bytestring is authentic.

Returns Error if it is inauthentic, or otherwise returns ().

Implementations on Foreign Types§

Source§

impl Verifier<Signature> for Keypair

Source§

fn verify(&self, message: &[u8], signature: &Signature) -> Result<(), Error>

Verify a signature on a message with this keypair’s public key.

Source§

impl Verifier<Signature> for PublicKey

Source§

fn verify(&self, message: &[u8], signature: &Signature) -> Result<(), Error>

Verify a signature on a message with this keypair’s public key.

§Return

Returns Ok(()) if the signature is valid, and Err otherwise.

Implementors§