pub struct KeyRotationPayload {
pub old_pubkey_hex: String,
pub new_pubkey_hex: String,
pub old_signature_hex: String,
pub new_signature_hex: String,
pub grace_period_secs: u64,
pub rotated_at_unix: u64,
}Expand description
Dual-signed key-rotation payload embedded in a chain event.
Fields§
§old_pubkey_hex: StringPrevious Ed25519 public key (32 bytes, hex-encoded).
new_pubkey_hex: StringNew Ed25519 public key (32 bytes, hex-encoded).
old_signature_hex: StringEd25519 signature over the canonical message by the old key (64 bytes, hex).
new_signature_hex: StringEd25519 signature over the canonical message by the new key (64 bytes, hex).
grace_period_secs: u64Seconds after rotated_at_unix during which the old key remains
accepted for verification (grace / overlap window).
rotated_at_unix: u64Unix timestamp (seconds) when the rotation was produced.
Implementations§
Source§impl KeyRotationPayload
impl KeyRotationPayload
Sourcepub fn canonical_message(
old_pubkey: &[u8; 32],
new_pubkey: &[u8; 32],
grace_period_secs: u64,
rotated_at_unix: u64,
) -> Vec<u8> ⓘ
pub fn canonical_message( old_pubkey: &[u8; 32], new_pubkey: &[u8; 32], grace_period_secs: u64, rotated_at_unix: u64, ) -> Vec<u8> ⓘ
Build the domain-separated canonical bytes both keys must sign.
Sourcepub fn decode_pubkey(hex_str: &str) -> Result<[u8; 32], KeyRotationError>
pub fn decode_pubkey(hex_str: &str) -> Result<[u8; 32], KeyRotationError>
Decode hex pubkey to 32 raw bytes.
Sourcepub fn decode_signature(hex_str: &str) -> Result<[u8; 64], KeyRotationError>
pub fn decode_signature(hex_str: &str) -> Result<[u8; 64], KeyRotationError>
Decode hex signature to 64 raw bytes.
Sourcepub fn from_event_payload(payload: &Value) -> Result<Self, KeyRotationError>
pub fn from_event_payload(payload: &Value) -> Result<Self, KeyRotationError>
Parse payload from a chain event JSON value.
Trait Implementations§
Source§impl Clone for KeyRotationPayload
impl Clone for KeyRotationPayload
Source§impl Debug for KeyRotationPayload
impl Debug for KeyRotationPayload
Source§impl<'de> Deserialize<'de> for KeyRotationPayload
impl<'de> Deserialize<'de> for KeyRotationPayload
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 KeyRotationPayload
Source§impl PartialEq for KeyRotationPayload
impl PartialEq for KeyRotationPayload
Source§impl Serialize for KeyRotationPayload
impl Serialize for KeyRotationPayload
impl StructuralPartialEq for KeyRotationPayload
Auto Trait Implementations§
impl Freeze for KeyRotationPayload
impl RefUnwindSafe for KeyRotationPayload
impl Send for KeyRotationPayload
impl Sync for KeyRotationPayload
impl Unpin for KeyRotationPayload
impl UnsafeUnpin for KeyRotationPayload
impl UnwindSafe for KeyRotationPayload
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