Config

Trait Config 

Source
pub trait Config: Debug {
    type Strategy: Strategy;

    // Required method
    fn keys(&self) -> Vec<Secret<[u8; 32]>>;

    // Provided method
    fn primary_key(&self) -> Secret<[u8; 32]> { ... }
}
Expand description

A trait to define the configuration for an EncryptedMessage. This allows you to effectively define different keys for different kinds of data if needed.

Required Associated Types§

Required Methods§

Source

fn keys(&self) -> Vec<Secret<[u8; 32]>>

Returns a list of keys to use for encryption.

The first key is considered the primary key, & is always used for encryption. The next keys are used in the order provided when the primary key can’t decrypt an EncryptedMessage. This allows for key rotation.

Provided Methods§

Source

fn primary_key(&self) -> Secret<[u8; 32]>

Returns the primary key, which is the first key in Config::keys.

Implementors§