[][src]Trait sequoia_openpgp::parse::stream::VerificationHelper

pub trait VerificationHelper {
    fn get_public_keys(&mut self, ids: &[KeyHandle]) -> Result<Vec<Cert>>;
fn check(&mut self, structure: MessageStructure) -> Result<()>; }

Helper for signature verification.

Required methods

fn get_public_keys(&mut self, ids: &[KeyHandle]) -> Result<Vec<Cert>>

Retrieves the certificates containing the specified keys.

When implementing this method, you should return as many certificates corresponding to the ids as you can.

If an identifier is ambiguous, because, for instance, there are multiple certificates with the same Key ID, then you should return all of them.

You should only return an error if processing should be aborted. In general, you shouldn't return an error if you don't have a certificate for a given identifier: if there are multiple signatures, then, depending on your policy, verifying a subset of them may be sufficient.

This method will be called at most once per message.

fn check(&mut self, structure: MessageStructure) -> Result<()>

Conveys the message structure.

The message structure contains the results of signature verifications. See MessageStructure for more information.

This is called after the last signature has been verified. This is the place to implement your verification policy. Check that the required number of signatures or notarizations were confirmed as valid.

When verifying a message, this callback will be called before all of the data has been returned. That is, once io::Read returns EOF, this callback will not be called. As such, any error returned by this function will abort reading, and the error will be propagated via the io::Read operation.

This method will be called at most once per message.

Loading content...


Loading content...