Skip to main content

Decryptable

Trait Decryptable 

Source
pub trait Decryptable<Ids: KeySlotIds, Key: KeySlotId, Output> {
    // Required method
    fn decrypt(
        &self,
        ctx: &mut KeyStoreContext<'_, Ids>,
        key: Key,
    ) -> Result<Output, CryptoError>;
}
Expand description

A decryption operation that takes the input value and decrypts it into the output value. Implementations should generally consist of calling Decryptable::decrypt for all the fields of the type.

Decrypt must decrypt the item fully, and not leave parts encrypted. That is, decrypt(K1) -> encrypt(K2) -> decrypt(K2) MUST succed.

Required Methods§

Source

fn decrypt( &self, ctx: &mut KeyStoreContext<'_, Ids>, key: Key, ) -> Result<Output, CryptoError>

Decrypts self into an Output under key. See the trait-level contract: the result must contain no cipher text.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<Ids: KeySlotIds, Key: KeySlotId, T: Decryptable<Ids, Key, Output>, Output> Decryptable<Ids, Key, Option<Output>> for Option<T>

Source§

fn decrypt( &self, ctx: &mut KeyStoreContext<'_, Ids>, key: Key, ) -> Result<Option<Output>, CryptoError>

Source§

impl<Ids: KeySlotIds, Key: KeySlotId, T: Decryptable<Ids, Key, Output>, Output> Decryptable<Ids, Key, Vec<Output>> for Vec<T>

Source§

fn decrypt( &self, ctx: &mut KeyStoreContext<'_, Ids>, key: Key, ) -> Result<Vec<Output>, CryptoError>

Implementors§