KeyManager

Trait KeyManager 

Source
pub trait KeyManager {
    // Required methods
    fn get(&self, name: &str) -> Result<Option<KeyPair>>;
    fn list_names(&self) -> Result<Vec<String>>;
    fn list(&self) -> Result<Vec<KeyPair>>;
    fn delete(&self, name: &str) -> Result<()>;
    fn save(&self, name: &str, key: &KeyPair) -> Result<()>;
}
Expand description

A trait that can be implemented by anything that needs to manage nkeys

Required Methods§

Source

fn get(&self, name: &str) -> Result<Option<KeyPair>>

Returns the named keypair. Returns None if the key doesn’t exist in the manager

Source

fn list_names(&self) -> Result<Vec<String>>

List all key names available

Source

fn list(&self) -> Result<Vec<KeyPair>>

Retrieves all keys. Note that this could be an expensive operation depending on the implementation

Source

fn delete(&self, name: &str) -> Result<()>

Deletes a named keypair

Source

fn save(&self, name: &str, key: &KeyPair) -> Result<()>

Saves the given keypair with the given name

Implementors§