Skip to main content

KeyRevocation

Struct KeyRevocation 

Source
pub struct KeyRevocation {
    pub revoked_key_fingerprint: String,
    pub compromised_since: DateTime<Utc>,
    pub reason: Option<String>,
    pub revoked_key_id: Option<String>,
    pub revoked_key_controller: AgentDid,
    pub publisher: AgentDid,
    pub trust_class: RevocationTrustClass,
}
Expand description

Typed, shape-validated view of a key-revocation context body (RFC-ACDP-0014 §4).

Obtain via KeyRevocation::from_body. Field semantics:

  • The fingerprint is authoritative; revoked_key_id is human traceability only (§4).
  • compromised_since is the compromise boundary T: signatures made strictly before T are attributable to the producer; at or after T they are not (§7). Across a superseding revocation lineage the earliest T is effective (§4, effective_boundary).
  • A revocation is permanent — there is no un-revoking. Consumers SHOULD cache verified revocations indefinitely (§7); the type is serde-serializable for exactly that.

Fields§

§revoked_key_fingerprint: String

RFC-ACDP-0010 §6 fingerprint of the revoked public key (sha256: + 64 lowercase hex), byte-for-byte the encoding receipts record. Authoritative over revoked_key_id.

§compromised_since: DateTime<Utc>

The compromise boundary T (canonical millisecond RFC 3339 UTC on the wire).

§reason: Option<String>

Optional human-readable circumstances (≤ 1024 chars). Informational only — apply output hygiene before display (RFC-ACDP-0014 §13).

§revoked_key_id: Option<String>

Optional DID URL of the revoked verification method. On any disagreement with the fingerprint, the fingerprint governs.

§revoked_key_controller: AgentDid

The producer DID that controls the revoked key. Defaults to the body’s agent_id when the metadata field is absent (producer-signed form); on registry-attested revocations it names the affected producer while agent_id is the registry.

§publisher: AgentDid

The body’s agent_id — the identity the revocation was published under (the producer for RevocationTrustClass::ProducerSigned, the registry for RevocationTrustClass::RegistryAttested).

§trust_class: RevocationTrustClass

§5/§6 trust class, derived from the controller binding: revoked_key_controller absent or equal to agent_id ⇒ producer-signed; different ⇒ registry-attested. MUST NOT be collapsed when reporting (§6). For a registry-attested claim the caller still owns confirming that publisher really is the DID of a registry it talks to (capabilities.registry_did).

Implementations§

Source§

impl KeyRevocation

Source

pub fn from_body(body: &Body) -> Result<KeyRevocation, AcdpError>

Parse and shape-validate a key-revocation context body per RFC-ACDP-0014 §4.

Enforced here (violations are AcdpError::SchemaViolation, the code a 0.3.0 registry rejects them with at publish):

  • type is key-revocation (or the §10 interim acdp:key-revocation).
  • visibility is public — an audience-restricted revocation protects nobody outside the audience.
  • metadata.revoked_key_fingerprint present, in the RFC-ACDP-0010 §6 form sha256: + 64 lowercase hex.
  • metadata.compromised_since present, canonical millisecond-precision RFC 3339 UTC (RFC-ACDP-0001 §5.3).
  • metadata.reason, when present, ≤ 1024 characters.
  • metadata.revoked_key_controller, when present, a valid DID.

Additionally, when the signing key’s fingerprint is derivable purely from the body (a did:key signer), the §5 step 2 not-self-signed rule is enforced here too. For did:web signers the fingerprint requires DID resolution: callers MUST follow up with Self::check_not_self_signed against the resolved fingerprint (acdp-client’s revocation pipeline does).

This does NOT verify the body’s hash or signature — a parsed revocation is untrusted until the strict §5.11 pipeline passes.

Source

pub fn check_not_self_signed( &self, signing_key_fingerprint: &str, ) -> Result<(), AcdpError>

RFC-ACDP-0014 §5 step 2 — the revocation MUST NOT be signed by the very key it revokes: such a statement proves only possession of the (by hypothesis, attacker-held) key. Registries at ≥ 0.3.0 reject the publish with key_not_authorized; consumers MUST treat one as unverified (at most a hint to seek a real signal).

signing_key_fingerprint is the RFC-ACDP-0010 §6 fingerprint of the resolved key that signed the revocation body (see acdp_crypto::fingerprint).

Source

pub fn revokes(&self, key_fingerprint: &str) -> bool

True when this revocation applies to the given signing-key fingerprint (RFC-ACDP-0010 §6 encoding, exact match).

Trait Implementations§

Source§

impl Clone for KeyRevocation

Source§

fn clone(&self) -> KeyRevocation

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 KeyRevocation

Source§

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

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

impl<'de> Deserialize<'de> for KeyRevocation

Source§

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

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

impl Eq for KeyRevocation

Source§

impl PartialEq for KeyRevocation

Source§

fn eq(&self, other: &KeyRevocation) -> 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 KeyRevocation

Source§

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

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

impl StructuralPartialEq for KeyRevocation

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> 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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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<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