Skip to main content

SecretStore

Trait SecretStore 

Source
pub trait SecretStore: Send + Sync {
    // Required methods
    fn read(&self, name: &str) -> Result<Option<Zeroizing<Vec<u8>>>>;
    fn write(&self, name: &str, bytes: &[u8]) -> Result<()>;
    fn remove(&self, name: &str) -> Result<()>;
}
Expand description

Where an Identity keeps its secrets (seed, node.key, keys): bytes by name. Implement it over the OS keystore to keep them out of files.

Required Methods§

Source

fn read(&self, name: &str) -> Result<Option<Zeroizing<Vec<u8>>>>

The secret, or None when it is not stored.

Source

fn write(&self, name: &str, bytes: &[u8]) -> Result<()>

Store (replace) the secret.

Source

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

Forget the secret (no error when it is not stored).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§