pub(crate) trait PrimitiveEncryptableWithContentType<Ids: KeyIds, Key: KeyId, Output> {
// Required method
fn encrypt(
&self,
ctx: &mut KeyStoreContext<'_, Ids>,
key: Key,
content_format: ContentFormat,
) -> Result<Output, CryptoError>;
}
Expand description
An encryption operation that takes the input value - a primitive such as Vec<u8>
- and
encrypts it into the output value. The caller must specify the content format.
Required Methods§
Sourcefn encrypt(
&self,
ctx: &mut KeyStoreContext<'_, Ids>,
key: Key,
content_format: ContentFormat,
) -> Result<Output, CryptoError>
fn encrypt( &self, ctx: &mut KeyStoreContext<'_, Ids>, key: Key, content_format: ContentFormat, ) -> Result<Output, CryptoError>
Encrypts a primitive, given an externally provided content type