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

pub trait DecryptionHelper {
    fn get_secret(
        &mut self,
        pkesks: &[&PKESK],
        skesks: &[&SKESK]
    ) -> Result<Option<Secret>>; fn mapping(&self) -> bool { ... }
fn inspect(&mut self, pp: &PacketParser) -> Result<()> { ... }
fn cache_asymmetric_secret(
        &mut self,
        pkesk: &PKESK,
        algo: SymmetricAlgorithm,
        key: &SessionKey
    ) { ... }
fn cache_symmetric_secret(
        &mut self,
        skesk: &SKESK,
        algo: SymmetricAlgorithm,
        key: &SessionKey
    ) { ... } }

Helper for decrypting messages.

Required methods

fn get_secret(
    &mut self,
    pkesks: &[&PKESK],
    skesks: &[&SKESK]
) -> Result<Option<Secret>>

Retrieves the secret needed to decrypt the data.

This function is called with every PKESK and SKESK found in the message. It is called repeatedly until either the decryption succeeds, or this function returns None.

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<()>

Called once per packet.

Can be used to dump packets in encrypted messages. The default implementation does nothing.

fn cache_asymmetric_secret(
    &mut self,
    pkesk: &PKESK,
    algo: SymmetricAlgorithm,
    key: &SessionKey
)

Signals success decrypting the given PKESK.

This can be used to cache the result of the asymmetric crypto operation. The default implementation does nothing.

fn cache_symmetric_secret(
    &mut self,
    skesk: &SKESK,
    algo: SymmetricAlgorithm,
    key: &SessionKey
)

Signals success decrypting the given SKESK.

This can be used to cache the result of the symmetric crypto operation. The default implementation does nothing.

Loading content...

Implementors

Loading content...