pub struct Keystore { /* private fields */ }Implementations§
Source§impl Keystore
impl Keystore
pub fn new(path: impl Into<PathBuf>) -> Self
pub fn default_path() -> PathBuf
pub fn unlock(&self, passphrase: &str) -> Result<()>
Sourcepub fn unlock_machine(&self) -> Result<()>
pub fn unlock_machine(&self) -> Result<()>
Unlock with a deterministic machine-derived passphrase (hostname + username).
Security note: This provides convenience-only protection. The passphrase
is derived from publicly-known values and does NOT protect against local
attackers who know the machine’s hostname and username. Use a user-supplied
passphrase via unlock() for secrets requiring real confidentiality.
pub fn is_unlocked(&self) -> bool
pub fn get(&self, key: &str) -> Option<String>
pub fn set(&self, key: &str, value: &str) -> Result<()>
pub fn remove(&self, key: &str) -> Result<bool>
pub fn list_keys(&self) -> Vec<String>
pub fn import(&self, new_entries: HashMap<String, String>) -> Result<usize>
pub fn lock(&self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Keystore
impl RefUnwindSafe for Keystore
impl Send for Keystore
impl Sync for Keystore
impl Unpin for Keystore
impl UnsafeUnpin for Keystore
impl UnwindSafe for Keystore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more