Skip to main content

Keyring

Trait Keyring 

Source
pub trait Keyring {
    // Required methods
    fn get_master_key(&self) -> Result<MasterKey, CoreError>;
    fn set_master_key(&self, key: &MasterKey) -> Result<(), CoreError>;
}
Expand description

Source of the vault master key. The store and registry depend on this trait, not on any concrete backend, so they are testable without an OS keyring.

Required Methods§

Source

fn get_master_key(&self) -> Result<MasterKey, CoreError>

Fetch the master key, materializing it (e.g. reading the OS keyring or deriving from a passphrase).

Source

fn set_master_key(&self, key: &MasterKey) -> Result<(), CoreError>

Persist the master key (e.g. write it to the OS keyring). Backends that derive the key (see Argon2Keyring) have nothing to store and return an error.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§