Trait Decryptable

Source
pub trait Decryptable<E> {
    // Provided methods
    fn decrypt(key: &Key, encrypted: &E) -> Result<Self, CryptError>
       where E: Ciphertext + Nonce,
             Self: ProstDecode { ... }
    fn decrypt_with_cipher(
        cipher: &XChaCha20Poly1305,
        encrypted: &E,
    ) -> Result<Self, CryptError>
       where E: Ciphertext + Nonce,
             Self: ProstDecode { ... }
}
Expand description

Decryptable from data structures that include nonces.

This is the main decryption trait for data structures that carry their own nonce, providing a convenient interface for symmetric decryption.

Provided Methods§

Source

fn decrypt(key: &Key, encrypted: &E) -> Result<Self, CryptError>
where E: Ciphertext + Nonce, Self: ProstDecode,

Decrypt using a key and encrypted data that includes its own nonce.

Source

fn decrypt_with_cipher( cipher: &XChaCha20Poly1305, encrypted: &E, ) -> Result<Self, CryptError>
where E: Ciphertext + Nonce, Self: ProstDecode,

Decrypt using a pre-initialized cipher instance.

Useful when you already have a cipher instance and want to avoid the overhead of re-creating it.

Implementations on Foreign Types§

Source§

impl Decryptable<(GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>>, Vec<u8>)> for MessageVaultPassport

Source§

impl Decryptable<CredentialVault> for Credentials

Source§

impl Decryptable<Envelope> for MessageVaultPassport

Source§

impl Decryptable<GenericVault> for Key

Source§

impl Decryptable<GenericVault> for SharedSecretKeys

Source§

impl Decryptable<MessageVaultSeed> for Message

Source§

impl Decryptable<SealedEnvelopeId> for EnvelopeId

Source§

impl Decryptable<SealedMessageVaultId> for MessageVaultId

Implementors§