Skip to main content

Module cawg

Module cawg 

Source

Structs§

HashedUri
A hashed URI reference to a C2PA assertion.

Functions§

create_identity_assertion_ica
Create a CAWG Identity Claims Aggregation (ICA) identity assertion — the production path c2pa-rs ships. Builds the cogmem ICA shape: a signer_payload {referenced_assertions, sig_type}, a W3C VC v2 of type IdentityClaimsAggregationCredential issued by the agent’s did:jwk, secured by a tag-18 COSE_Sign1 (EdDSA, application/vc) over the VC JSON, embedded as {signer_payload, signature, pad1}. referenced is (url, alg, raw_hash) and MUST include the hard binding (a c2pa.hash.* assertion). Returns the JSON wrapper stored under the cawg.identity assertion label: {"alg":"EdDSA","ica":"<base64 CBOR>"}, whose ica field is the embedded IdentityAssertion CBOR that verify_cawg_ica reads back.
hash_assertion
Build a HashedUri from a label and content bytes (hex-encoded SHA-256 digest).
ica_embedded_bytes
Read the embedded IdentityAssertion CBOR bytes from a cawg.identity assertion JSON produced by create_identity_assertion_ica (the base64-encoded ica field).
verify_cawg_ica
Verify a CAWG Identity Claims Aggregation (ICA) identity assertion from its raw CBOR bytes — the cawg.identity assertion box content {signer_payload, signature, pad1}. The signature is a tag-18 COSE_Sign1 (application/vc) over the W3C VC JSON, signed by the did:jwk issuer. Checks: sig_type is ICA, a hard binding is referenced, and the COSE signature is valid under the issuer DID. Returns the verified, parsed VC JSON.