pub struct SecretStore { /* private fields */ }Expand description
File-backed secret store using AES-256-GCM encryption.
Secrets are stored as JSON with restrictive file permissions (0600). Values are encrypted with a 32-byte master key. Legacy XOR-encrypted values are auto-migrated to AES-256-GCM on first open.
Implementations§
Source§impl SecretStore
impl SecretStore
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self>
pub fn open(path: impl AsRef<Path>) -> Result<Self>
Open an existing secrets file or create a new empty one.
Sourcepub fn open_with_key(path: impl AsRef<Path>, key_path: &Path) -> Result<Self>
pub fn open_with_key(path: impl AsRef<Path>, key_path: &Path) -> Result<Self>
Open with a specific master key path (useful for testing).
Sourcepub fn set(
&mut self,
key: impl Into<String>,
value: impl Into<String>,
) -> Result<()>
pub fn set( &mut self, key: impl Into<String>, value: impl Into<String>, ) -> Result<()>
Add or update a secret.
Trait Implementations§
Source§impl Debug for SecretStore
impl Debug for SecretStore
Source§impl<'de> Deserialize<'de> for SecretStore
impl<'de> Deserialize<'de> for SecretStore
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SecretStore
impl RefUnwindSafe for SecretStore
impl Send for SecretStore
impl Sync for SecretStore
impl Unpin for SecretStore
impl UnsafeUnpin for SecretStore
impl UnwindSafe for SecretStore
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