pub struct EscrowCache { /* private fields */ }Expand description
A client-side cached copy of the server escrow blob.
Fetched at enrollment and refreshed opportunistically (SSoT § Local Verification); the stale-cache rule refreshes it before ever recording a verification failure, so a rotation on another device can never manufacture a false failure here.
It carries the blob’s stored_at when this client knows it — from
its own store_escrow, or from a
verify that refreshed against a known instant. A blob
fetched with GET /v1/auth/escrow alone has none: that operation serves the bytes and
nothing else.
Implementations§
Source§impl EscrowCache
impl EscrowCache
Sourcepub fn new(blob: WrappedSecret) -> Self
pub fn new(blob: WrappedSecret) -> Self
Wrap an already-decoded escrow blob as the local cache, with no known stored_at.
Sourcepub fn with_stored_at(blob: WrappedSecret, stored_at: Timestamp) -> Self
pub fn with_stored_at(blob: WrappedSecret, stored_at: Timestamp) -> Self
Wrap an escrow blob whose server stored_at is known — the blob this client just
stored, paired with the EscrowStored::stored_at the server answered.
Sourcepub fn blob(&self) -> &WrappedSecret
pub fn blob(&self) -> &WrappedSecret
The cached wrapped-master-key escrow blob.
Sourcepub fn stored_at(&self) -> Option<Timestamp>
pub fn stored_at(&self) -> Option<Timestamp>
When the server stored the cached blob, when this client knows it.
Sourcepub fn is_older_than(&self, latest: Timestamp) -> bool
pub fn is_older_than(&self, latest: Timestamp) -> bool
Whether an escrow stored at latest is newer than this copy. A copy with no known
stored_at cannot prove it is current, so it counts as older.
Trait Implementations§
Source§impl Clone for EscrowCache
impl Clone for EscrowCache
Source§fn clone(&self) -> EscrowCache
fn clone(&self) -> EscrowCache
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 EscrowCache
impl Debug for EscrowCache
impl Eq for EscrowCache
Source§impl PartialEq for EscrowCache
impl PartialEq for EscrowCache
Source§fn eq(&self, other: &EscrowCache) -> bool
fn eq(&self, other: &EscrowCache) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for EscrowCache
Auto Trait Implementations§
impl Freeze for EscrowCache
impl RefUnwindSafe for EscrowCache
impl Send for EscrowCache
impl Sync for EscrowCache
impl Unpin for EscrowCache
impl UnsafeUnpin for EscrowCache
impl UnwindSafe for EscrowCache
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> CompatExt for T
impl<T> CompatExt for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more