Skip to main content

Aead

Trait Aead 

Source
pub trait Aead: Send + Sync {
    // Required methods
    fn seal(&self, plaintext: &[u8]) -> Result<Vec<u8>, CryptoError>;
    fn open(&self, ciphertext: &[u8]) -> Result<Vec<u8>, CryptoError>;

    // Provided methods
    fn is_current(&self, _blob: &[u8]) -> bool { ... }
    fn active_key_id(&self) -> String { ... }
}

Required Methods§

Source

fn seal(&self, plaintext: &[u8]) -> Result<Vec<u8>, CryptoError>

Source

fn open(&self, ciphertext: &[u8]) -> Result<Vec<u8>, CryptoError>

Provided Methods§

Source

fn is_current(&self, _blob: &[u8]) -> bool

Whether this blob is already sealed under the key seal would use. Rewrapping asks this so it can skip values that need no work; a single-key implementation has nothing to rotate to, hence the default.

Source

fn active_key_id(&self) -> String

A short, stable label for the key seal is using, so an operator can confirm which key a replica actually holds.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§