Skip to main content

KeyEncryptable

Trait KeyEncryptable 

Source
pub trait KeyEncryptable<Key: CryptoKey, Output> {
    // Required method
    fn encrypt_with_key(self, key: &Key) -> Result<Output, CryptoError>;
}
Expand description

An encryption operation that takes the input value and encrypts it into the output value using a key reference. Implementing this requires a content type to be specified in the implementation.

Required Methods§

Source

fn encrypt_with_key(self, key: &Key) -> Result<Output, CryptoError>

Encrypts a value using the provided key reference.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl KeyEncryptable<PinKey, EncString> for String

Source§

impl KeyEncryptable<SymmetricCryptoKey, EncString> for &str

Source§

impl KeyEncryptable<SymmetricCryptoKey, EncString> for String

Source§

impl<T: KeyEncryptable<Key, Output> + Send + Sync, Key: CryptoKey + Send + Sync, Output: Send + Sync, Id: Hash + Eq + Send + Sync> KeyEncryptable<Key, HashMap<Id, Output>> for HashMap<Id, T>

Source§

fn encrypt_with_key(self, key: &Key) -> Result<HashMap<Id, Output>, CryptoError>

Source§

impl<T: KeyEncryptable<Key, Output> + Send + Sync, Key: CryptoKey + Send + Sync, Output: Send + Sync> KeyEncryptable<Key, Vec<Output>> for Vec<T>

Source§

fn encrypt_with_key(self, key: &Key) -> Result<Vec<Output>, CryptoError>

Source§

impl<T: KeyEncryptable<Key, Output>, Key: CryptoKey, Output> KeyEncryptable<Key, Option<Output>> for Option<T>

Source§

impl<T: KeyEncryptable<Key, Output>, Key: CryptoKey, Output> KeyEncryptable<Key, Output> for Box<T>

Source§

fn encrypt_with_key(self, key: &Key) -> Result<Output, CryptoError>

Implementors§