Trait Encryptable

Source
pub trait Encryptable<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 and encrypts it into the output value. Implementations should generally consist of calling Encryptable::encrypt for all the fields of the type.

Required Methods§

Source

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

Implementations on Foreign Types§

Source§

impl<Ids: KeyIds> Encryptable<Ids, <Ids as KeyIds>::Asymmetric, AsymmetricEncString> for &str

Source§

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

Source§

impl<Ids: KeyIds> Encryptable<Ids, <Ids as KeyIds>::Asymmetric, AsymmetricEncString> for &[u8]

Source§

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

Source§

impl<Ids: KeyIds> Encryptable<Ids, <Ids as KeyIds>::Asymmetric, AsymmetricEncString> for String

Source§

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

Source§

impl<Ids: KeyIds> Encryptable<Ids, <Ids as KeyIds>::Asymmetric, AsymmetricEncString> for Vec<u8>

Source§

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

Source§

impl<Ids: KeyIds> Encryptable<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> Encryptable<Ids, <Ids as KeyIds>::Symmetric, EncString> for &[u8]

Source§

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

Source§

impl<Ids: KeyIds> Encryptable<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> Encryptable<Ids, <Ids as KeyIds>::Symmetric, EncString> for Vec<u8>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§