pub struct DerivedKeyProvider { /* private fields */ }Expand description
Derives per-audience LocalKeyCiphers from one login-derived master secret
(HKDF-SHA256), caching by audience. The master comes from the Parslee login
(per-user) / entitlements (per-org); it is NEVER sent to the relay.
Implementations§
Source§impl DerivedKeyProvider
impl DerivedKeyProvider
Sourcepub fn new(master: impl Into<Vec<u8>>) -> Self
pub fn new(master: impl Into<Vec<u8>>) -> Self
Build over a raw master secret (already stable across the user’s devices, e.g. a per-user sync key Parslee issued at login).
Sourcepub fn from_login_secret(login_secret: &[u8], user_id: &str) -> Self
pub fn from_login_secret(login_secret: &[u8], user_id: &str) -> Self
Build from login material bound to user_id — HKDF the raw secret into a
stable per-user master so two logins for the same user converge on the
same keys and different users never collide.
Sourcepub fn from_passphrase(passphrase: &str, user_id: &str) -> Self
pub fn from_passphrase(passphrase: &str, user_id: &str) -> Self
Build from a user sync passphrase — the zero-knowledge cross-device
key source that needs NO server key distribution: every device on which
the user enters the same passphrase derives the same keys, and Parslee
(relay + platform) never sees it. user_id domain-separates users. This
is the recommended source today; a Parslee-issued per-user master
(delivered over the authenticated channel) is the alternative, and both
land here as the master secret.