[][src]Struct securestore::SecretsManager

pub struct SecretsManager { /* fields omitted */ }

The primary interface used for interacting with the SecureStore.

Methods

impl SecretsManager[src]

pub fn new<P1: AsRef<Path>, P2: AsRef<Path>>(
    path: P1,
    key_source: KeySource<P2>
) -> Result<Self, Error>
[src]

Creates a new vault on-disk at path path and loads it in a new instance of SecretsManager.

pub fn load<P1: AsRef<Path>, P2: AsRef<Path>>(
    path: P1,
    key_source: KeySource<P2>
) -> Result<Self, Error>
[src]

Creates a new instance of SecretsManager referencing an existing vault located on-disk.

pub fn save(&self) -> Result<(), Error>[src]

Saves changes to the underlying vault specified by the path supplied during construction of this SecretsManager instance.

pub fn export_keyfile<P: AsRef<Path>>(&self, path: P) -> Result<(), Error>[src]

Exports the private key(s) resident in memory to a path on-disk. Note that in addition to being used for exporting existing keys previously loaded into the secrets store and keys newly generated by the secrets store, it can also be used to export keys derived from passwords to their equivalent keyfiles to facilitate subsequent passwordless access.

pub fn get<T: BinaryDeserializable>(&self, name: &str) -> Result<T, Error>[src]

Decrypts and retrieves a single secret from the loaded store. If the secret cannot be found, returns Err(ErrorKind::SecretNotFound)

pub fn set<T: BinarySerializable>(&mut self, name: &str, value: T)[src]

Adds a new secret or replaces an existing secret identified by name to the store.

pub fn remove(&mut self, name: &str) -> Result<(), Error>[src]

Remove a secret identified by name from the store.

pub fn keys<'a>(&'a self) -> impl Iterator<Item = &'a str>[src]

Retrieve a list of the names of secrets stored in the vault.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.