pub struct SealedVault {
pub scheme_version: u32,
pub params: KdfParams,
/* private fields */
}Expand description
The sealed-at-rest vault. Serialized (hex-encoded byte fields) to a root-owned
0600 file on headless hosts, or wrapped by an OS keychain on desktops.
Fields§
§scheme_version: u32§params: KdfParamsImplementations§
Source§impl SealedVault
impl SealedVault
Sourcepub fn verify_password(&self, password: &str) -> bool
pub fn verify_password(&self, password: &str) -> bool
Whether password matches (constant-time). Does not unseal.
Sourcepub fn auth_challenge(&self) -> (String, KdfParams)
pub fn auth_challenge(&self) -> (String, KdfParams)
The inputs a client needs to compute an auth proof: the verifier salt and the KDF params. Handed out by the daemon in a challenge — neither is secret.
Sourcepub fn verify_proof(&self, nonce: &[u8], op: &[u8], proof: &[u8]) -> bool
pub fn verify_proof(&self, nonce: &[u8], op: &[u8], proof: &[u8]) -> bool
Verify a challenge-response proof for operation op under nonce. The
proof is an AEAD tag over an empty message, keyed by the password verifier,
with nonce (the daemon’s fresh 24-byte challenge) and op as AAD — so the
password never crosses the wire and a captured proof can’t be replayed for a
different nonce/op. Compared constant-time.
Sourcepub fn unseal(&self, password: &str) -> Result<LockedSettings, AdminError>
pub fn unseal(&self, password: &str) -> Result<LockedSettings, AdminError>
Decrypt the locked settings with the admin password.
Sourcepub fn unseal_with_recovery(
&self,
recovery_key: &str,
) -> Result<LockedSettings, AdminError>
pub fn unseal_with_recovery( &self, recovery_key: &str, ) -> Result<LockedSettings, AdminError>
Decrypt the locked settings with the recovery key (no password needed).
Sourcepub fn update_settings(
&self,
password: &str,
new_settings: &LockedSettings,
) -> Result<SealedVault, AdminError>
pub fn update_settings( &self, password: &str, new_settings: &LockedSettings, ) -> Result<SealedVault, AdminError>
Re-seal new settings, authenticated by the current password. Re-encrypts the settings slot (fresh nonce) while preserving the verifier and recovery slot — i.e. the same password + recovery key still work.
Sourcepub fn change_password(
&self,
old: &str,
new: &str,
) -> Result<Provisioned, AdminError>
pub fn change_password( &self, old: &str, new: &str, ) -> Result<Provisioned, AdminError>
Change the admin password. Re-derives the verifier and re-seals the settings + recovery slot under the new password. The recovery key is rotated (a fresh one is returned).
Trait Implementations§
Source§impl Clone for SealedVault
impl Clone for SealedVault
Source§fn clone(&self) -> SealedVault
fn clone(&self) -> SealedVault
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SealedVault
impl Debug for SealedVault
Source§impl<'de> Deserialize<'de> for SealedVault
impl<'de> Deserialize<'de> for SealedVault
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>,
impl Eq for SealedVault
Source§impl PartialEq for SealedVault
impl PartialEq for SealedVault
Source§fn eq(&self, other: &SealedVault) -> bool
fn eq(&self, other: &SealedVault) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for SealedVault
impl Serialize for SealedVault
impl StructuralPartialEq for SealedVault
Auto Trait Implementations§
impl Freeze for SealedVault
impl RefUnwindSafe for SealedVault
impl Send for SealedVault
impl Sync for SealedVault
impl Unpin for SealedVault
impl UnsafeUnpin for SealedVault
impl UnwindSafe for SealedVault
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.