pub trait EncryptData {
// Required method
fn encrypt_data(
&self,
cipher: &Aes256Gcm,
data: &[u8],
) -> CryptoKeystoreResult<Vec<u8>>;
}Expand description
This trait is intended to provide a convenient way to encrypt data.
The encryption process embeds both a nonce and an AAD: an identity comprising both the entity’s type and a unique identifier.
There is a blanket implementation covering all Entitys.
Required Methods§
Sourcefn encrypt_data(
&self,
cipher: &Aes256Gcm,
data: &[u8],
) -> CryptoKeystoreResult<Vec<u8>>
fn encrypt_data( &self, cipher: &Aes256Gcm, data: &[u8], ) -> CryptoKeystoreResult<Vec<u8>>
Encrypt some data, using a random nonce and an AAD.