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
Symmetric encryption/decryption of arbitrary byte payloads.
Required Methods§
fn encrypt( &self, plaintext: &[u8], ) -> Result<EncryptionResult, OperationOutcomeError>
fn decrypt( &self, ciphertext: &EncryptionResult, ) -> Result<Vec<u8>, OperationOutcomeError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".