pub trait Encryptor: Sync + Send {
// Required methods
fn encrypt(
&self,
plaintext: &[u8],
) -> Result<EncryptionResult, OperationOutcomeError>;
fn decrypt(
&self,
ciphertext: &EncryptionResult,
) -> Result<Vec<u8>, OperationOutcomeError>;
}Expand description
Provides symmetric authenticated encryption and decryption of arbitrary byte payloads.
Implementations are expected to encrypt data in a way that ensures both
confidentiality and integrity. A value returned by Self::encrypt
should be decryptable only by the same implementation initialized with the
same keying material.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".