pub struct MessageVerifier { /* private fields */ }Expand description
A MessageVerifier performs the verifications needed for a signed message.
Implementations§
Source§impl MessageVerifier
impl MessageVerifier
Sourcepub fn parse<P>(
message: &impl SignedMessage,
alg: Option<Algorithm>,
pick: P,
) -> Result<Self, ImplementationError>
pub fn parse<P>( message: &impl SignedMessage, alg: Option<Algorithm>, pick: P, ) -> Result<Self, ImplementationError>
Parse a message into a structure that is ready for verification against an
external key with a suitable algorithm. If alg is not set, a default will
be chosen from the alg parameter. pick is a predicate
enabling you to choose which message label should be considered as the message to
verify - if it is known only one signature is in the message, simply return true.
§Errors
Returns ImplementationErrors relevant to verifying and parsing.
Sourcepub fn get_details(&self) -> ParameterDetails
pub fn get_details(&self) -> ParameterDetails
Retrieve the parsed ParameterDetails from the message. Useful for logging
information about the message.
Sourcepub fn verify(
self,
keyring: &KeyRing,
key_id: Option<Thumbprint>,
) -> Result<SignatureTiming, ImplementationError>
pub fn verify( self, keyring: &KeyRing, key_id: Option<Thumbprint>, ) -> Result<SignatureTiming, ImplementationError>
Verify the messsage, consuming the verifier in the process.
If key_id is not supplied, a key ID to fetch the public key
from keyring will be sourced from the keyid parameter
within the message. Returns information about how long verification
took if successful.
§Errors
Returns ImplementationErrors relevant to verifying and parsing.
Sourcepub fn is_expired(&self) -> Option<bool>
pub fn is_expired(&self) -> Option<bool>
Whether or not this message is expired, based on its expires value.
Trait Implementations§
Source§impl Clone for MessageVerifier
impl Clone for MessageVerifier
Source§fn clone(&self) -> MessageVerifier
fn clone(&self) -> MessageVerifier
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more