pub struct MasterSecret { /* private fields */ }Expand description
The vault-level KDF output. Derive ONCE per open (the expensive step), then zeroize the passphrase — every other key HKDF-derives from this (spec §4.3). Carries the salt it was derived under so entry/mac/registry keys need no extra context.
Implementations§
Source§impl MasterSecret
impl MasterSecret
Sourcepub fn derive(passphrase: &str, salt: &[u8; 16]) -> Self
pub fn derive(passphrase: &str, salt: &[u8; 16]) -> Self
PBKDF2-HMAC-SHA256 @ 600k over the passphrase. The caller should drop (zeroize) the passphrase immediately after this returns.
pub fn salt(&self) -> &[u8; 16]
Sourcepub fn registry_key(&self) -> Zeroizing<[u8; 32]>
pub fn registry_key(&self) -> Zeroizing<[u8; 32]>
Key for the raw-key registry container (spec §6.2).
Auto Trait Implementations§
impl Freeze for MasterSecret
impl RefUnwindSafe for MasterSecret
impl Send for MasterSecret
impl Sync for MasterSecret
impl Unpin for MasterSecret
impl UnsafeUnpin for MasterSecret
impl UnwindSafe for MasterSecret
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