[−][src]Trait sequoia_openpgp::crypto::Decryptor
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:
KeyPair
: In-memory keys.sequoia_rpc::gnupg::KeyPair
: Connects to thegpg-agent
.
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]
&mut self,
ciphertext: &Ciphertext,
plaintext_len: Option<usize>
) -> Result<SessionKey>
Decrypts ciphertext
, returning the plain session key.
Implementors
impl Decryptor for KeyPair
[src]
pub fn public(&self) -> &Key<PublicParts, UnspecifiedRole>
[src]
pub fn decrypt(
&mut self,
ciphertext: &Ciphertext,
plaintext_len: Option<usize>
) -> Result<SessionKey>
[src]
&mut self,
ciphertext: &Ciphertext,
plaintext_len: Option<usize>
) -> Result<SessionKey>