pub trait CompositeEncryptable<Ids: KeyIds, Key: KeyId, Output> {
// Required method
fn encrypt_composite(
&self,
ctx: &mut KeyStoreContext<'_, Ids>,
key: Key,
) -> Result<Output, CryptoError>;
}
Expand description
An encryption operation that takes the input value and encrypts the fields on it recursively. Implementations should generally consist of calling PrimitiveEncryptable::encrypt for all the fields of the type. Sometimes, it is necessary to call CompositeEncryptable::encrypt_composite, if the object is not a flat struct.
Required Methods§
Sourcefn encrypt_composite(
&self,
ctx: &mut KeyStoreContext<'_, Ids>,
key: Key,
) -> Result<Output, CryptoError>
fn encrypt_composite( &self, ctx: &mut KeyStoreContext<'_, Ids>, key: Key, ) -> Result<Output, CryptoError>
For a struct made up of many small encstrings, such as a cipher, this takes the struct and recursively encrypts all the fields / sub-structs.