Trait PrimitiveEncryptableWithContentType

Source
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§

Source

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

Encrypts a primitive, given an externally provided content type

Implementations on Foreign Types§

Source§

impl<Ids: KeyIds> PrimitiveEncryptableWithContentType<Ids, <Ids as KeyIds>::Symmetric, EncString> for &[u8]

Source§

fn encrypt( &self, ctx: &mut KeyStoreContext<'_, Ids>, key: Ids::Symmetric, content_format: ContentFormat, ) -> Result<EncString, CryptoError>

Source§

impl<Ids: KeyIds> PrimitiveEncryptableWithContentType<Ids, <Ids as KeyIds>::Symmetric, EncString> for Vec<u8>

Source§

fn encrypt( &self, ctx: &mut KeyStoreContext<'_, Ids>, key: Ids::Symmetric, content_format: ContentFormat, ) -> Result<EncString, CryptoError>

Source§

impl<Ids: KeyIds, Key: KeyId, T: PrimitiveEncryptableWithContentType<Ids, Key, Output>, Output> PrimitiveEncryptableWithContentType<Ids, Key, Option<Output>> for Option<T>

Source§

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

Source§

impl<Ids: KeyIds, Key: KeyId, T: PrimitiveEncryptableWithContentType<Ids, Key, Output>, Output> PrimitiveEncryptableWithContentType<Ids, Key, Vec<Output>> for Vec<T>

Source§

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

Implementors§