Skip to main content

RotationAttestation

Struct RotationAttestation 

Source
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: u32

Schema version. Always 1 for now.

§uuid: String

Agent UUIDv7 — stable across rotations.

§algorithm: String

Signing algorithm. “ed25519” for now.

§old_pubkey: String

Outgoing pubkey (multibase). Empty string for the bootstrap entry only.

§new_pubkey: String

Incoming pubkey (multibase). Always present.

§old_key_version: u32§new_key_version: u32

= old_key_version + 1 for non-emergency rotations.

§rotated_at: String

RFC3339 timestamp.

§reason: RotationReason§signature: String

Multibase Ed25519 signature over canonical_bytes(). Empty for Emergency reason or for the bootstrap entry.

§bootstrap: bool

True only for the create-time entry (no prior key existed).

Implementations§

Source§

impl RotationAttestation

Source

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.

Source

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.

Source

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.

Source

pub fn sign(&mut self, signing: &SigningKey)

Compute the Ed25519 signature using the given signing key and store it in self.signature. Idempotent.

Source

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.

Source

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

Source§

fn clone(&self) -> RotationAttestation

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RotationAttestation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for RotationAttestation

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for RotationAttestation

Source§

fn eq(&self, other: &RotationAttestation) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for RotationAttestation

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for RotationAttestation

Source§

impl StructuralPartialEq for RotationAttestation

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyEq for T
where T: Any + PartialEq,

Source§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,