Skip to main content

Crate acdp_verify

Crate acdp_verify 

Source
Expand description

High-level body / publish-request verification — RFC-ACDP-0001 §5.11 (7-step algorithm).

This layer sits above validation, types, crypto, and did: it recomputes the content_hash, runs structural validation, resolves the producer DID, and verifies the signature envelope. The byte-level primitives (acdp_crypto::verify_ed25519 / acdp_crypto::verify_ecdsa_p256) live in crypto.

Modules§

trust
RFC-ACDP-0020 §5.2 for a list carried out of band (§7): verify a did:key-issued trust-list body offline and turn it into a ListVersion.

Structs§

Verifier
Stateless verifier. Requires a DID resolver to fetch producer keys.

Enums§

LineageBinding
How a verified body’s lineage_id is bound to its lineage.

Functions§

lifecycle_event_prechecks
The pure (offline) prefix of RFC-ACDP-0013 §5 lifecycle-event verification, shared by the resolver-backed and did:key paths:
lineage_binding
Classify how body.lineage_id is bound, given whether a receipt for it was verified. Call after verify_registry_assigned_bindings.
raw_describes_body
true when re-parsing raw yields exactly the typed body (compared through the canonical typed serialization).
verify_body_offline
Full offline body verification for did:key producers — works with --no-default-features (no HTTP stack, no resolver, no async).
verify_body_signature_historical
Historical-key body-signature verification (ACDP 0.2, WS-B).
verify_body_signature_historical_since
verify_body_signature_historical with an explicit freshness scope: a DID document fetched at or after since is fresh; an older cached copy that lacks the key is re-fetched once (RFC-ACDP-0001 §5.11 “Caching”).
verify_body_value_offline
verify_body_offline over the body object exactly as received (RFC-ACDP-0001 §5.7 raw-JSON hashing). Returns the parsed Body on success. The language bindings use this so a host passing wire JSON gets the normative raw-hash path.
verify_context_hash
Recompute content_hash for a retrieved context, hashing the raw received body when available (RFC-ACDP-0001 §5.7).
verify_ctx_id_binding
Verify that a served body’s ctx_id is the one the caller actually requested — RFC-ACDP-0006 §4.1 step 7 (NORMATIVE, “Bind the resolved identity”).
verify_did_key_envelope
Verify a signature envelope whose key is a did:key — a pure function available without the client feature (no resolver, no network, no async).
verify_lifecycle_event
Verify a lifecycle event per RFC-ACDP-0013 §5 — the helper both registries (at /retract//republish submission time, §6 step 3) and consumers (before treating an event as attributable evidence) use.
verify_lifecycle_event_offline
Offline counterpart of verify_lifecycle_event for did:key actors — no resolver, no network, works with --no-default-features. A did:web actor is refused with AcdpError::KeyResolution; use the resolver-backed helper.
verify_publish_request_signature
Verify the producer signature on a PublishRequest per RFC-ACDP-0003 §2.1 steps 6–7.
verify_publish_request_signature_offline
Offline counterpart of verify_publish_request_signature for did:key producers — used by registries (and the bindings) to verify a publish request without the client feature. Assumes structural validation and content_hash recomputation have already run (e.g. via PublishValidator::validate_post_schema).
verify_raw_body_hash
Recompute content_hash over raw (the body object as received) when it describes body; otherwise fall back to verify_typed_body_hash.
verify_registry_assigned_bindings
Enforce the offline registry-assigned bindings on a retrieved body:
verify_signature_with_method
Steps 5.5–7 of RFC-ACDP-0001 §5.11 against an already-located verification method — the synchronous core shared by the resolver-backed envelope, the historical-key path, and offline callers that select the DID document themselves (RFC-ACDP-0017 evidence bundles).
verify_typed_body_hash
Typed-path content_hash check for a Body (no raw JSON held).
verify_typed_content_hash
Check expected against the canonical typed rendering value, then against the legacy whole-second rendering of the same content.
verify_typed_publish_request_hash
Typed-path content_hash check for a PublishRequest.