pub struct RotationKey {
pub key: VerifyingKey,
pub key_id: String,
pub added_at: Instant,
pub expires_at: Option<Instant>,
pub is_primary: bool,
}Expand description
A key with its metadata for rotation
Fields§
§key: VerifyingKeyThe verifying key
key_id: StringKey ID for JWKS compatibility
added_at: InstantWhen this key was added
expires_at: Option<Instant>Optional: when this key should be removed (for grace period rotation)
is_primary: boolWhether this is the primary (current) key
Implementations§
Source§impl RotationKey
impl RotationKey
Sourcepub fn primary(key: VerifyingKey, key_id: impl Into<String>) -> RotationKey
pub fn primary(key: VerifyingKey, key_id: impl Into<String>) -> RotationKey
Create a new primary key
Sourcepub fn secondary(
key: VerifyingKey,
key_id: impl Into<String>,
grace_period: Duration,
) -> RotationKey
pub fn secondary( key: VerifyingKey, key_id: impl Into<String>, grace_period: Duration, ) -> RotationKey
Create a secondary (rotating out) key with expiration
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if this key has expired
Trait Implementations§
Source§impl Clone for RotationKey
impl Clone for RotationKey
Source§fn clone(&self) -> RotationKey
fn clone(&self) -> RotationKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Forget for RotationKey
impl Freeze for RotationKey
impl Move for RotationKey
impl RefUnwindSafe for RotationKey
impl Send for RotationKeywhere
RawVecInner: Send,
impl Sync for RotationKeywhere
RawVecInner: Sync,
impl Unpin for RotationKey
impl UnsafeUnpin for RotationKey
impl UnwindSafe for RotationKeywhere
RawVecInner: UnwindSafe,
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