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

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

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

pub fn public(&self) -> &Key<PublicParts, UnspecifiedRole>[src]

Returns a reference to the public key.

pub fn decrypt(
    &mut self,
    ciphertext: &Ciphertext,
    plaintext_len: Option<usize>
) -> Result<SessionKey>
[src]

Decrypts ciphertext, returning the plain session key.

Loading content...

Implementors

impl Decryptor for KeyPair[src]

Loading content...