pub struct KeyRotationEvent {
pub sequence: u128,
pub previous_hash: String,
pub old_public_key: Vec<u8>,
pub new_public_key: Vec<u8>,
pub timestamp: DateTime<Utc>,
pub rotation_signature: Vec<u8>,
}Expand description
Represents a key rotation event in the KERI Key Event Log (KEL).
This is a high-level representation of a key rotation that can be serialized to JSON for storage and transmission. The actual KERI event format (CESR) is handled at the storage layer.
Fields§
§sequence: u128Sequence number in the KEL (incrementing from 0)
previous_hash: StringHash of the previous event for backward chain verification. Empty string for inception events (sequence 0).
old_public_key: Vec<u8>Old public key being rotated from (32 bytes for Ed25519).
new_public_key: Vec<u8>New public key being rotated to (32 bytes for Ed25519).
timestamp: DateTime<Utc>ISO 8601 timestamp of the rotation event.
rotation_signature: Vec<u8>Signature proving authority to rotate (signed by the old key). This proves the holder of the old key authorized the rotation.
Implementations§
Source§impl KeyRotationEvent
impl KeyRotationEvent
Sourcepub fn new(
sequence: u128,
previous_hash: String,
old_public_key: Vec<u8>,
new_public_key: Vec<u8>,
timestamp: DateTime<Utc>,
rotation_signature: Vec<u8>,
) -> KeyRotationEvent
pub fn new( sequence: u128, previous_hash: String, old_public_key: Vec<u8>, new_public_key: Vec<u8>, timestamp: DateTime<Utc>, rotation_signature: Vec<u8>, ) -> KeyRotationEvent
Creates a new KeyRotationEvent.
Sourcepub fn canonical_bytes_for_signing(&self) -> Vec<u8> ⓘ
pub fn canonical_bytes_for_signing(&self) -> Vec<u8> ⓘ
Returns the canonical bytes for signing this event.
The canonical form includes all fields except the rotation_signature, serialized deterministically.
Trait Implementations§
Source§impl Clone for KeyRotationEvent
impl Clone for KeyRotationEvent
Source§fn clone(&self) -> KeyRotationEvent
fn clone(&self) -> KeyRotationEvent
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 KeyRotationEvent
impl Debug for KeyRotationEvent
Source§impl<'de> Deserialize<'de> for KeyRotationEvent
impl<'de> Deserialize<'de> for KeyRotationEvent
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<KeyRotationEvent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<KeyRotationEvent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for KeyRotationEvent
impl PartialEq for KeyRotationEvent
Source§fn eq(&self, other: &KeyRotationEvent) -> bool
fn eq(&self, other: &KeyRotationEvent) -> bool
self and other values to be equal, and is used by ==.