decrypt

Function decrypt 

Source
pub(crate) async fn decrypt(
    context: &Context,
    mail: &ParsedMail<'_>,
) -> Result<Option<(Message<'static>, Option<String>)>>
Expand description

Tries to decrypt the message, returning a tuple of (decrypted message, fingerprint).

If the message wasn’t encrypted, returns Ok(None).

If the message was asymmetrically encrypted, returns Ok((decrypted message, None)).

If the message was symmetrically encrypted, returns Ok((decrypted message, Some(fingerprint))), where fingerprint denotes which contact is allowed to send encrypted with this symmetric secret. If the message is not signed by fingerprint, it must be dropped.

Otherwise, Eve could send a message to Alice encrypted with the symmetric secret of someone else’s broadcast channel. If Alice sends an answer (or read receipt), then Eve would know that Alice is in the broadcast channel.