pub struct RotationAttestation {
pub schema: u32,
pub uuid: String,
pub algorithm: String,
pub old_pubkey: String,
pub new_pubkey: String,
pub old_key_version: u32,
pub new_key_version: u32,
pub rotated_at: String,
pub reason: RotationReason,
pub signature: String,
pub bootstrap: bool,
}Expand description
Cryptographic proof of an identity-key rotation.
signature is multibase base58btc Ed25519 over canonical_bytes()
(which serializes every field except signature itself).
For reason = Emergency, signature MAY be empty — those rotations
require out-of-band admin approval to take effect.
Fields§
§schema: u32Schema version. Always 1 for now.
uuid: StringAgent UUIDv7 — stable across rotations.
algorithm: StringSigning algorithm. “ed25519” for now.
old_pubkey: StringOutgoing pubkey (multibase). Empty string for the bootstrap entry only.
new_pubkey: StringIncoming pubkey (multibase). Always present.
old_key_version: u32§new_key_version: u32= old_key_version + 1 for non-emergency rotations.
rotated_at: StringRFC3339 timestamp.
reason: RotationReason§signature: StringMultibase Ed25519 signature over canonical_bytes(). Empty for Emergency reason or for the bootstrap entry.
bootstrap: boolTrue only for the create-time entry (no prior key existed).
Implementations§
Source§impl RotationAttestation
impl RotationAttestation
Sourcepub fn new(
uuid: impl Into<String>,
old_pubkey: impl Into<String>,
new_pubkey: impl Into<String>,
old_key_version: u32,
new_key_version: u32,
rotated_at: impl Into<String>,
reason: RotationReason,
) -> Self
pub fn new( uuid: impl Into<String>, old_pubkey: impl Into<String>, new_pubkey: impl Into<String>, old_key_version: u32, new_key_version: u32, rotated_at: impl Into<String>, reason: RotationReason, ) -> Self
Build a new (unsigned) attestation.
Sourcepub fn into_bootstrap(self) -> Self
pub fn into_bootstrap(self) -> Self
Mark this attestation as the bootstrap entry written at agent
create time. Bootstrap entries have empty old_pubkey and empty
signature; they exist only to anchor the rotation chain.
Sourcepub fn canonical_bytes(&self) -> Vec<u8> ⓘ
pub fn canonical_bytes(&self) -> Vec<u8> ⓘ
Canonical bytes used for signing. Serializes every field of self
EXCEPT signature (which is being computed) using JSON with sorted
keys and no whitespace.
Sourcepub fn sign(&mut self, signing: &SigningKey)
pub fn sign(&mut self, signing: &SigningKey)
Compute the Ed25519 signature using the given signing key and store
it in self.signature. Idempotent.
Sourcepub fn verify(&self, old_pubkey: &str) -> Result<(), IdentityError>
pub fn verify(&self, old_pubkey: &str) -> Result<(), IdentityError>
Verify self.signature against the supplied multibase-encoded
old_pubkey. Returns Ok(()) on a valid signature.
Bootstrap entries (bootstrap = true) are accepted unconditionally —
they have nothing to verify against.
Emergency entries (reason = Emergency) with empty signature are
REJECTED here; callers must use verify_or_emergency if they want
the emergency-allowed semantics.
Sourcepub fn verify_or_emergency(&self, old_pubkey: &str) -> Result<(), IdentityError>
pub fn verify_or_emergency(&self, old_pubkey: &str) -> Result<(), IdentityError>
Like verify, but accepts emergency rotations with empty signature.
Caller is responsible for the out-of-band approval check.
Trait Implementations§
Source§impl Clone for RotationAttestation
impl Clone for RotationAttestation
Source§fn clone(&self) -> RotationAttestation
fn clone(&self) -> RotationAttestation
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 RotationAttestation
impl Debug for RotationAttestation
Source§impl<'de> Deserialize<'de> for RotationAttestation
impl<'de> Deserialize<'de> for RotationAttestation
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>,
Source§impl PartialEq for RotationAttestation
impl PartialEq for RotationAttestation
Source§fn eq(&self, other: &RotationAttestation) -> bool
fn eq(&self, other: &RotationAttestation) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for RotationAttestation
impl Serialize for RotationAttestation
impl Eq for RotationAttestation
impl StructuralPartialEq for RotationAttestation
Auto Trait Implementations§
impl Freeze for RotationAttestation
impl RefUnwindSafe for RotationAttestation
impl Send for RotationAttestation
impl Sync for RotationAttestation
impl Unpin for RotationAttestation
impl UnsafeUnpin for RotationAttestation
impl UnwindSafe for RotationAttestation
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key and return true if they are equal.