pub struct RegistryReceipt {
pub registry_did: String,
pub ctx_id: CtxId,
pub lineage_id: LineageId,
pub origin_registry: String,
pub created_at: DateTime<Utc>,
pub content_hash: ContentHash,
pub key_fingerprint: String,
pub signature: Signature,
}Expand description
A registry-signed publication receipt.
CLOSED schema (RFC-ACDP-0010 §4, additionalProperties: false):
a receipt has exactly the eight specified members. Future receipt
fields require a schema bump, not field-level extensibility —
unknown members are rejected at parse time.
Fields§
§registry_did: StringThe registry’s own identity — MUST be did:web:<authority>
where <authority> is the authority the context is served from.
ctx_id: CtxIdThe ctx_id this receipt attests.
lineage_id: LineageIdThe lineage the registry assigned.
origin_registry: StringThe registry’s authority (bare hostname form).
created_at: DateTime<Utc>Publication acceptance time. Canonical millisecond-precision
RFC 3339 UTC, always serialized with exactly three fractional
digits (…SS.mmmZ, RFC-ACDP-0010 §8 step 6) — chrono’s default
drops trailing zeros, which would change the preimage bytes.
content_hash: ContentHashThe producer’s content hash this receipt binds.
key_fingerprint: StringFingerprint of the producer key the registry resolved and
verified at publish time (see acdp_crypto::fingerprint).
signature: SignatureRegistry signature over the receipt preimage.
Implementations§
Source§impl RegistryReceipt
impl RegistryReceipt
Sourcepub fn from_value(value: &Value) -> Result<Self, AcdpError>
pub fn from_value(value: &Value) -> Result<Self, AcdpError>
Parse a receipt from the opaque JSON value carried in
crate::body::FullContext::registry_receipt.
Sourcepub fn preimage_hash_of_value(value: &Value) -> Result<ContentHash, AcdpError>
pub fn preimage_hash_of_value(value: &Value) -> Result<ContentHash, AcdpError>
Compute the preimage hash from the RAW wire JSON of a receipt
(the value minus signature, canonicalized as received).
Verifiers MUST hash the receipt exactly as received rather than re-serializing a parsed struct — the same “hash verification over raw JSON” rule as RFC-ACDP-0001 §6 bodies. Re-serialization can normalize byte details (e.g. timestamp fraction digits) and falsely fail an honest receipt.
Sourcepub fn validate_created_at_form(value: &Value) -> Result<(), AcdpError>
pub fn validate_created_at_form(value: &Value) -> Result<(), AcdpError>
Validate the §8 step 6 byte form of the receipt’s raw
created_at: canonical millisecond-precision RFC 3339 UTC with
exactly three fractional digits and a literal Z.
Sourcepub fn cross_check_body(&self, body: &Body) -> Result<(), AcdpError>
pub fn cross_check_body(&self, body: &Body) -> Result<(), AcdpError>
§8 step 3 body bindings: lineage_id, origin_registry, and
created_at MUST equal the corresponding fields of the
accompanying body. (ctx_id is bound separately against the
requested identifier in Self::cross_check.)
Sourcepub fn preimage_hash(&self) -> Result<ContentHash, AcdpError>
pub fn preimage_hash(&self) -> Result<ContentHash, AcdpError>
Compute the receipt’s signature preimage hash: SHA-256 over the
JCS canonical form of the receipt minus signature only.
Struct-based form, used at MINT time (the struct’s serializer
emits the canonical three-digit-millisecond created_at).
Verifiers should prefer Self::preimage_hash_of_value over
the raw wire JSON.
Sourcepub fn verify_signature_with_key(
&self,
registry_pub_ed25519: Option<&[u8; 32]>,
registry_pub_p256_sec1: Option<&[u8]>,
) -> Result<(), AcdpError>
pub fn verify_signature_with_key( &self, registry_pub_ed25519: Option<&[u8; 32]>, registry_pub_p256_sec1: Option<&[u8]>, ) -> Result<(), AcdpError>
Verify the receipt signature against a known registry public
key (pure — no DID resolution; the client feature’s
verify_receipt_value resolves the registry DID and calls
this).
Sourcepub fn verify_signature_against_hash(
&self,
hash: &ContentHash,
registry_pub_ed25519: Option<&[u8; 32]>,
registry_pub_p256_sec1: Option<&[u8]>,
) -> Result<(), AcdpError>
pub fn verify_signature_against_hash( &self, hash: &ContentHash, registry_pub_ed25519: Option<&[u8; 32]>, registry_pub_p256_sec1: Option<&[u8]>, ) -> Result<(), AcdpError>
Like Self::verify_signature_with_key but over an
already-computed preimage hash — pair with
Self::preimage_hash_of_value for raw-JSON verification.
Sourcepub fn cross_check(
&self,
expected_ctx_id: &CtxId,
recomputed_body_hash: &ContentHash,
producer_key_fingerprint: &str,
) -> Result<(), AcdpError>
pub fn cross_check( &self, expected_ctx_id: &CtxId, recomputed_body_hash: &ContentHash, producer_key_fingerprint: &str, ) -> Result<(), AcdpError>
The pure (offline) subset of the RFC-ACDP-0010 cross-checks —
everything except registry-DID resolution and the
served-authority comparison, which need the client feature:
ctx_idequals the requested one.content_hashequals the independently recomputed body hash (pass the recomputed value, never the body’s echoed field).key_fingerprintequals the fingerprint of the resolved producer key.created_atis millisecond-truncated.registry_didisdid:web:<origin_registry>(internal consistency; the serving-authority comparison is the client’s job).
Trait Implementations§
Source§impl Clone for RegistryReceipt
impl Clone for RegistryReceipt
Source§fn clone(&self) -> RegistryReceipt
fn clone(&self) -> RegistryReceipt
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more