Expand description
The c2pa.soft-binding assertion emitted for each algorithm in this family.
This builds the normative soft-binding-map from the C2PA specification
(soft-binding.cddl) as deterministic CBOR. The structure mirrors the
c2pa-rs reference reader’s SoftBinding type field-for-field, so the bytes
produced here deserialize directly into that reader — see
tests/c2pa_roundtrip.rs, which decodes them with the exact CBOR codec
(c2pa_cbor) that c2pa-rs uses and reconstructs its SoftBinding.
Per the CDDL, a block’s value is algorithm-specific. The reference reader
types it as a text string, so every value here is the algorithm’s hex
encoding (the same hex the registry descriptions record). Window scopes for
the surface fingerprint are carried as textual character ranges
(region-of-interest.cddl Textual); the offsets are into the algorithm’s
normalized character stream, which is where the fingerprint is computed.
Emitting an assertion is not signing it: [to_cbor] returns the assertion
bytes, which the caller signs with crate::manifest::sign_cose. Presence
in the C2PA soft-binding algorithm list is not conformance certification.
Structs§
- Block
- A single
soft-binding-block-map: a scope plus the value over that scope. - Range
- A single range. Only the textual variant is produced here.
- Region
OfInterest - A minimal region of interest carrying one or more
Ranges. - Scope
- A
soft-binding-scope-map. Only the textualregionis used by this family; an empty scope means the whole asset. - Soft
Binding - A
soft-binding-map: one or more soft bindings over the asset’s content. - Text
- A textual range: one or more character-offset selectors.
- Text
Selector - A character-offset selector.
fragmentis required by the C2PA type; for plain text there is no sub-resource, so it is empty. - Text
Selector Range - One
[start, end)character range over the normalized stream.
Enums§
- Range
Type - The C2PA
RangeTypediscriminator (camelCase on the wire).
Constants§
- ALG_
FINGERPRINT - Registered algorithm identifier for
text-fingerprint.1(list id 41). - ALG_
MINHASH - Registered algorithm identifier for
text-minhash.1(list id 44). - ALG_
STRUCTURE - Registered algorithm identifier for
text-structure.1(list id 43). - ALG_
WATERMARK - Registered algorithm identifier for
zwc-watermark.2(list id 42). - SOFT_
BINDING_ LABEL - The C2PA assertion label a soft-binding payload is stored under.
Functions§
- from_
fingerprint - Build the
text-fingerprint.1(list id 41) soft binding: the whole-document SimHash plus one scoped block per overlapping window. - from_
minhash - Build the
text-minhash.1(list id 44) soft binding. The value is the 128 signature values as big-endianu64bytes, hex-encoded — a deterministic, verifier-reproducible serialization of the recorded signature. - from_
structure - Build the
text-structure.1(list id 43) soft binding: the whole-document structural SimHash. - from_
watermark_ pointer - Build the
zwc-watermark.2(list id 42) soft binding. The value is the routing pointer embedded in the carrier, hex-encoded — the identifier a manifest repository is keyed by.