Skip to main content

Using the CAWG identity assertion

The CAI Rust library includes an implementation of the Creator Assertions Working Group (CAWG) identity assertion specification.

Known limitations

The library does not currently support the following optional fields from the CAWG identity assertion:

  • expected_partial_claim
  • expected_claim_generator
  • expected_countersigners

Example

The code in sdk/examples/cawg.rs provides a minimal example of signing and verifying a claim including a CAWG identitiy assertion. Run it by entering the command:

cargo run --example cawg -- <SOURCE_FILE> <OUTPUT_FILE>

Where <SOURCE_FILE> is the relative path to the input asset file and <OUTPUT_FILE> is the relative path where the example saves the resulting asset file containing the CAWG identity assertion.

cargo run --example cawg -- ./sdk/tests/fixtures/CA.jpg cawg-out.jpg

Example assertion:

...
"assertions": [
{
"label": "c2pa.actions",
"data": {
"actions": [
{
"action": "c2pa.opened"
}
]
}
},
{
"label": "cawg.identity",
"data": {
"signer_payload": {
"referenced_assertions": [
{
"url": "self#jumbf=c2pa.assertions/c2pa.hash.data",
"hash": "Vw/g3K8zOlhOOEk1GZmMLgqXVZKUbaxUxRLWvm0C30s="
}
],
"sig_type": "cawg.x509.cose"
},
"signature_info": {
"alg": "Ed25519",
"issuer": "C2PA Test Signing Cert",
"cert_serial_number": "638838410810235485828984295321338730070538954823",
"revocation_status": true
}
}
},
...
]

C2PA Tool also displays CAWG identity assertions.