Trait PrimitiveEncryptable

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

An encryption operation that takes the input value - a primitive such as String and encrypts it into the output value. The implementation decides the content format.

Required Methods§

Source

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

Encrypts a primitive without requiring an externally provided content type

Implementations on Foreign Types§

Source§

impl<Ids: KeyIds> PrimitiveEncryptable<Ids, <Ids as KeyIds>::Symmetric, EncString> for &str

Source§

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

Source§

impl<Ids: KeyIds> PrimitiveEncryptable<Ids, <Ids as KeyIds>::Symmetric, EncString> for String

Source§

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

Source§

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

Source§

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

Implementors§