data-slots=heading, text
CAI Soft binding resolution API
A soft binding in a C2PA manifest enables recovering the manifest for an asset even when the manifest has been stripped from the asset. You can use the soft binding to look up the C2PA manifest within an online manifest repository. Soft bindings are described using soft binding assertions such as a fingerprint computed from the digital content or an invisible watermark embedded within the digital content. These soft bindings enable digital content to be matched even if the underlying bits differ.
For more information, see:
Workflow
Follow this process to retrieve manifest data for an asset watermarked with TrustMark:
- Extract the watermark ID from the asset by using the TrustMark API.
- Retrieve manifest IDs of assets in the Adobe Content Credentials Cloud that match the watermark ID by using the
/matches/byContentroute. - Retrieve manifest store for each matching manifest ID.
Extract watermark ID from asset
Using an image with a TrustMark watermark, retrieve the watermark ID using the TrustMark API. TrustMark has implementations in Python, Rust, and JavaScript. For example, here's how to do it in Python, using the decode() method:
from trustmark import TrustMark
from PIL import Image
import base64
EXAMPLE_FILE = 'path_to_watermarked_image.jpeg'
MODE='P'
tm=TrustMark(verbose=True, model_type=MODE, encoding_type=TrustMark.Encoding.BCH_4)
stego = Image.open(EXAMPLE_FILE).convert('RGB')
wm_secret, wm_present, wm_schema = tm.decode(stego, MODE='binary')
modified_wm_secret = "2*" + wm_secret
encoded_bytes = base64.b64encode( modified_wm_secret.encode('utf-8') )
encoded_watermark_string = encoded_bytes.decode('utf-8')
print(f"Watermark: {wm_secret}")
print(f"Base64 encoded watermark: {encoded_watermark_string}")
The result is a base 64 encoded value like MioxMDAxMDAxMTAxMTAwMDAxMDAxMTEwMDEwMDExMTAxMDAwMTExMTEwMDEwMTAwMTExMDEwMDAwMTEwMDEwMTEwMTExMA==
Retrieve manifest IDs that match the watermark
Use the /matches/byContent route with the the value of encoded_watermark_string (the base64-encoded watermark with "2*" prepended), to fetch the manifest IDs that match the watermark.
The API supports the following query parameters:
alg: The fingerprint algorithm applied; must be one of the C2PA approved fingerprint algorithms. Adobe Content Authenticity usescom.adobe.icn.dense, the Adobe Image Comparator Network Dense Fingerprint.hintAlg: The watermark algorithm applied; must be one of the C2PA approved watermark algorithms. Adobe Content Authenticity usescom.adobe.trustmark.P, TrustMark Variant P.hintValue: The base64-encoded watermark with "2*" prepended. This is the value ofencoded_watermark_stringin the example code above.
For example:
curl -X POST \
-T <<PATH_TO_IMAGE_FILE>> \
-H 'content-type: image/jpeg' \
-H 'x-api-key: <<API_KEY>>' \
'https://cai-msb.adobe.io/sbapi/matches/byContent?alg=com.adobe.icn.dense&hintAlg=com.adobe.trustmark.P&hintValue=MioxMDAxMDAxMTAxMTAwMDAxMDAxMTEwMDEwMDExMTAxMDAwMTExMTEwMDEwMTAwMTExMDEwMDAwMTEwMDEwMTEwMTExMA=='
The response will look something like this:
{ "matches":
[
{ "manifestId":"urn-c2pa-93470c24-11e8-4879-9492-28e8625cf357-adobe",
"endpoint":"https://cai-manifests.adobe.com/",
"similarityScore":null }
]
}
In the response, the value of the manifestId property is the manifest ID of the asset.
Retrieve manifest store
Use the manifest ID value with the manifests/{manifestID} route to get the actual CBOR manifest store, like this:
https://cai-manifests.adobe.com/manifests/<<MANIFEST_ID>>
For example:
https://cai-manifests.adobe.com/manifests/urn-c2pa-93470c24-11e8-4879-9492-28e8625cf357-adobe
You can also view the image on the Adobe Content Authenticity website, providing the manifest ID in the URL like this:
https://contentauthenticity.adobe.com/inspect
?source=https%3A%2F%2Fcai-manifests.adobe.com%2Fmanifests%2F<<MANIFEST_ID>>
For example:
API reference
Try the API using the Swagger UI. Read the endpoint descriptions and make test API calls.