Trait sequoia_openpgp::crypto::Decryptor[][src]

pub trait Decryptor {
    fn public(&self) -> &Key<PublicParts, UnspecifiedRole>;
fn decrypt(
        &mut self,
        ciphertext: &Ciphertext,
        plaintext_len: Option<usize>
    ) -> Result<SessionKey>; }
Expand description

Decrypts a message.

Used by PKESK::decrypt to decrypt session keys.

This is a low-level mechanism to decrypt an arbitrary OpenPGP ciphertext. Using this trait allows Sequoia to perform all operations involving decryption to use a variety of secret key storage mechanisms (e.g. smart cards).

A decryptor consists of the public key and a way of decrypting a session key. This crate implements Decryptor for KeyPair, which is a tuple containing the public and unencrypted secret key in memory. Other crates may provide their own implementations of Decryptor to utilize keys stored in various places. Currently, the following implementations exist:

Required methods

Returns a reference to the public key.

Decrypts ciphertext, returning the plain session key.

Implementations on Foreign Types

Implementors