[−][src]Struct securestore::SecretsManager
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]
path: P1,
key_source: KeySource<P2>
) -> Result<Self, Error>
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]
path: P1,
key_source: KeySource<P2>
) -> Result<Self, Error>
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
impl RefUnwindSafe for SecretsManager
impl Send for SecretsManager
impl Sync for SecretsManager
impl Unpin for SecretsManager
impl UnwindSafe for SecretsManager
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,