Skip to main content

Encryptor

Trait Encryptor 

Source
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§

Source

fn encrypt( &self, plaintext: &[u8], ) -> Result<EncryptionResult, OperationOutcomeError>

Source

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".

Implementors§