Skip to main content

verify_metadata_binding

Function verify_metadata_binding 

Source
pub fn verify_metadata_binding(
    manifest: &AssetManifest,
    metadata_blob: &[u8],
    blob_key: &[u8; 32],
    signed_sidecar: &[u8],
) -> MetadataBinding
Expand description

Run the metadata↔manifest round-trip equivalence check for a metadata-bearing manifest (SSoT: Metadata — Local and Server Metadata Equivalence, Encryption — Local–server equivalence). Two facts must hold, both funnelling a failure into a quarantine:

  1. Content address — the metadata blob’s content hash equals the manifest’s committed metadata_blob_hash (the key-free half; the server enforces the same value at invariant 25).
  2. Round-trip — decrypting the blob under blob_key yields canonical CBOR byte-identical to signed_sidecar (the sidecar the client persists locally).

A client therefore never persists a sidecar that does not round-trip to the committed metadata_blob_hash.