Skip to main content

KeyStore

Trait KeyStore 

Source
pub trait KeyStore {
    // Required methods
    fn store(&mut self, tmb: &str, key: StoredKey) -> Result<(), Error>;
    fn get(&self, tmb: &str) -> Result<&StoredKey, Error>;
    fn list(&self) -> Vec<&str>;
    fn save(&self) -> Result<(), Error>;
}
Expand description

Keystore trait for private key storage.

Implementations may use files, OS keychains, HSMs, etc.

Required Methods§

Source

fn store(&mut self, tmb: &str, key: StoredKey) -> Result<(), Error>

Store a key by its thumbprint.

Source

fn get(&self, tmb: &str) -> Result<&StoredKey, Error>

Retrieve a key by its thumbprint.

Source

fn list(&self) -> Vec<&str>

List all stored key thumbprints.

Source

fn save(&self) -> Result<(), Error>

Persist changes to backing storage.

Implementors§