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

pub trait DecryptionHelper {
    fn decrypt<D>(
        &mut self,
        pkesks: &[PKESK],
        skesks: &[SKESK],
        decrypt: D
    ) -> Result<Option<Fingerprint>>
    where
        D: FnMut(SymmetricAlgorithm, &SessionKey) -> Result<()>
; fn mapping(&self) -> bool { ... }
fn inspect(&mut self, pp: &PacketParser) -> Result<()> { ... } }

Helper for decrypting messages.

Required methods

fn decrypt<D>(
    &mut self,
    pkesks: &[PKESK],
    skesks: &[SKESK],
    decrypt: D
) -> Result<Option<Fingerprint>> where
    D: FnMut(SymmetricAlgorithm, &SessionKey) -> Result<()>, 

Decrypts the message.

This function is called with every PKESK and SKESK found in the message. The implementation must decrypt the symmetric algorithm and session key from one of the PKESK packets, the SKESKs, or retrieve it from a cache, and then call decrypt with the symmetric algorithm and session key.

Loading content...

Provided methods

fn mapping(&self) -> bool

Turns mapping on or off.

If this function returns true, the packet parser will create a map of the packets. Note that this buffers the packets contents, and is not recommended unless you know that the packets are small. The default implementation returns false.

fn inspect(&mut self, pp: &PacketParser) -> Result<()>

Inspects the message.

Called once per packet. Can be used to dump packets in encrypted messages. The default implementation does nothing.

Loading content...

Implementors

Loading content...