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§
Sourcefn decrypt(
&self,
ctx: &mut KeyStoreContext<'_, Ids>,
key: Key,
) -> Result<Output, CryptoError>
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.