pub struct UserKeyHistory { /* private fields */ }Expand description
The current user key plus every key it replaced and when.
Implementations§
Source§impl UserKeyHistory
impl UserKeyHistory
Sourcepub fn from_records(
current: &[u8; 32],
records: &[RotationRecord],
) -> Result<Self, RotationError>
pub fn from_records( current: &[u8; 32], records: &[RotationRecord], ) -> Result<Self, RotationError>
Fold records (oldest first) into a history ending at current.
Every record must verify, link to its predecessor and continue its key.
Sourcepub fn key_for(&self, user_key_id: &str) -> Option<[u8; 32]>
pub fn key_for(&self, user_key_id: &str) -> Option<[u8; 32]>
The public key with this key_id, current or retired.
Sourcepub fn accepts(&self, pubkey: &[u8; 32], at: DateTime<Utc>) -> bool
pub fn accepts(&self, pubkey: &[u8; 32], at: DateTime<Utc>) -> bool
May pubkey have sealed something dated at? The current key always;
a retired key only up to (and including) its rotation point.
Sourcepub fn retired_keys(&self) -> impl Iterator<Item = [u8; 32]> + '_
pub fn retired_keys(&self) -> impl Iterator<Item = [u8; 32]> + '_
Public keys of every retired key, oldest first.
Trait Implementations§
Source§impl Clone for UserKeyHistory
impl Clone for UserKeyHistory
Auto Trait Implementations§
impl Freeze for UserKeyHistory
impl RefUnwindSafe for UserKeyHistory
impl Send for UserKeyHistory
impl Sync for UserKeyHistory
impl Unpin for UserKeyHistory
impl UnsafeUnpin for UserKeyHistory
impl UnwindSafe for UserKeyHistory
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
Converts
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> ⓘ
Converts
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