pub struct RotationRecord {
pub v: u32,
pub seq: u64,
pub old_pubkey: String,
pub old_key_id: String,
pub new_pubkey: String,
pub new_key_id: String,
pub rotated_at: String,
pub prev: Option<String>,
pub sig_old: String,
pub sig_new: String,
}Expand description
One dual-signed handover from old_pubkey to new_pubkey.
Fields§
§v: u32§seq: u641-based position in the log.
old_pubkey: StringKey being retired, 64 lowercase hex.
old_key_id: Stringkey_id(old_pubkey).
new_pubkey: StringKey taking over, 64 lowercase hex.
new_key_id: Stringkey_id(new_pubkey).
rotated_at: StringThe rotation point, YYYY-MM-DDTHH:MM:SSZ.
prev: Option<String>SHA-256 (Self::hash) of the previous record; absent for the first.
sig_old: StringHex signature by the old key.
sig_new: StringHex signature by the new key.
Implementations§
Source§impl RotationRecord
impl RotationRecord
Sourcepub fn sign(
old: &SigningKey,
new: &SigningKey,
prev: Option<&RotationRecord>,
rotated_at: DateTime<Utc>,
) -> Self
pub fn sign( old: &SigningKey, new: &SigningKey, prev: Option<&RotationRecord>, rotated_at: DateTime<Utc>, ) -> Self
Sign a handover with both keys. prev is the previous record, if any.
Sourcepub fn verify(&self) -> Result<(), RotationError>
pub fn verify(&self) -> Result<(), RotationError>
Shape and both signatures.
Trait Implementations§
Source§impl Clone for RotationRecord
impl Clone for RotationRecord
Source§impl Debug for RotationRecord
impl Debug for RotationRecord
Source§impl<'de> Deserialize<'de> for RotationRecord
impl<'de> Deserialize<'de> for RotationRecord
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for RotationRecord
Source§impl PartialEq for RotationRecord
impl PartialEq for RotationRecord
Source§impl Serialize for RotationRecord
impl Serialize for RotationRecord
impl StructuralPartialEq for RotationRecord
Auto Trait Implementations§
impl Freeze for RotationRecord
impl RefUnwindSafe for RotationRecord
impl Send for RotationRecord
impl Sync for RotationRecord
impl Unpin for RotationRecord
impl UnsafeUnpin for RotationRecord
impl UnwindSafe for RotationRecord
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,
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§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
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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