Skip to content

How to Check Content Credentials in a JPEG with c2patool

Check JPEG Content Credentials with c2patool. Compare unsigned, signed, and changed copies to interpret the manifest, file hash, and signer.

By Sourabh6 min read

Two JPEGs can look identical when you open them, even though a provenance check gives you different answers for each one.

Run c2patool on the JPEG. First, check whether it found a manifest.

If there is a manifest, check the signature, its link to the file, and whether the tool trusted the signer.

The distinction shows up clearly in a three-file test.

We inspected an unsigned image, a copy signed with a development credential, and a third copy with a JPEG comment added after signing.

The picture looked the same in each copy. The verification reports told three different stories.

Run the Check on One JPEG

Install C2PA Tool, the command-line validator from the Content Authenticity Initiative.

Open a terminal in the folder containing your JPEG. On Windows, you can use PowerShell.

Check your version first, then run the tool against a copy of the file you received.

bash
c2patool --version
c2patool "photo.jpg"

The tool reports the manifest and its validation results when it can find and read the credentials.

A manifest is a package of signed information associated with the file.

It may describe the software that signed it, actions the signer recorded, or an earlier asset used in producing the current one.

In a JPEG with embedded credentials, that package can be carried in JUMBF, a structure for organizing metadata.

Your JPEG viewer can display the photo without showing those fields.

Keep the file you received.

Screenshots, new JPEG exports, and apps that re-encode images can change the bytes you are checking.

Use the SHA-256 verification walkthrough if you need to confirm that your working copy matches the reference.

Check the file you received or a copy whose bytes you have verified.

For a report you can review later, save standard output and errors separately.

Choose a new report name if you already have a file with either name in the folder.

bash
c2patool "photo.jpg" > "photo-c2pa.json" 2> "photo-c2pa-errors.txt"

If the JSON file is empty, read the error file before you draw a conclusion.

An unreadable JPEG, a wrong path, and a readable JPEG with no credential found are different situations.

Read the Result in Three Parts

Did the Tool Find a Manifest?

In a report with multiple manifests, start with active_manifest. Its value identifies the manifest the tool selected for the current asset.

Earlier manifests or ingredient entries can give you context about inputs to the asset.

Keep them attached to the report, but read them separately from the active claim.

When the tool reports no claim, record the exact message and which copy you examined.

An unsigned picture, an export that omitted credentials, and a copy with credentials stored separately can all leave you without an embedded manifest.

Where your case materials include an associated sidecar or a known external manifest, examine that association before calling the provenance unavailable.

The Content Credentials lesson explains embedded and separately delivered information.

Do the Signature and File Binding Check Out?

In the validation results, claimSignature.validated means the tool verified the claim’s signature.

assertion.dataHash.match means the protected data matched the hash recorded in the claim.

The file binding is how the tool checks that the credential belongs with this copy.

Those checks answer separate questions. A claim can have a valid signature while the file fails the binding check.

Read the failure details if you see assertion.dataHash.mismatch. A mismatch gives you a reason to look for an earlier copy with intact credentials.

The report alone usually cannot tell you who changed the file, which application changed it, or what was visible before the change.

The Windows view is simulated. The selected results came from the same signed practice JPEG examined on macOS.

Is the Signer Trusted?

Signer trust is assessed separately from the file binding and the signature calculation.

The test certificate in our signed example produced signingCredential.untrusted even though the claim signature and data hash matched.

A result of Valid in that run still came with an untrusted-signer finding. Record both.

The signer identity is also separate from scene accuracy. A credential can support a statement about the asset and what the signer declared.

An investigator still needs other evidence to verify the time, location, or events shown.

Compare Three Copies of the Same Picture

We ran C2PA Tool 0.29.0 on macOS for the example below. The unsigned image was a small original graphic.

The second file was signed using the tool’s built-in development certificate. For the third, we inserted a JPEG comment into a separate copy after signing.

That changed the file bytes while the image still displayed the same picture.

In the changed copy, the validator could still read the manifest and validate the claim signature. Its data hash check failed.

All three practice JPEGs decoded to the same pixels. Their verification results differ.

Scroll horizontally if needed to see the full table.

CopyWhat the tool reportedWhat you can say
UnsignedNo claim foundThe tool found no claim in the file under the conditions of this check.
Signed with the development certificateValid, with assertion.dataHash.match and signingCredential.untrustedThe file binding matched, and the development signer was untrusted.
Changed after signingInvalid, with assertion.dataHash.mismatchThe manifest remained readable, and this copy failed the binding check.

The tool returned exit code zero for both reports that contained a manifest in this test. The changed copy still produced Invalid inside the JSON.

If you automate the check, examine the validation fields instead of treating a successful process exit as a verification result.

Report shapes and available status fields can differ by version.

Try It With a JPEG You Made

Make a simple JPEG of your own and save it as unsigned.jpg. Save the following as manifest.json. The declaration describes a software-created practice image.

json
{
  "title": "Practice image",
  "assertions": [
    {
      "label": "c2pa.actions.v2",
      "data": {
        "actions": [
          {
            "action": "c2pa.created",
            "digitalSourceType": "http://cv.iptc.org/newscodes/digitalsourcetype/softwareImage"
          }
        ]
      }
    }
  ]
}

With the same version used here, the command below signs a new copy with a development credential when no signing certificate or key is configured.

Use that default only in the exercise. Run the inspection command once on each version.

bash
c2patool unsigned.jpg -m manifest.json -o signed.jpg
c2patool unsigned.jpg
c2patool signed.jpg

For the third example, run this Python script in the same folder. It writes a new file and leaves the signed source alone.

Inserting the comment is a controlled way to change the signed bytes while keeping the original image data and manifest in the file.

python
from pathlib import Path

source = Path("signed.jpg").read_bytes()
if source[:2] != bytes.fromhex("FF D8"):
    raise ValueError("Expected a JPEG file")

comment = b"ForensicSpot binding test"
segment = bytes.fromhex("FF FE") + (len(comment) + 2).to_bytes(2, "big") + comment
with Path("changed.jpg").open("xb") as output:
    output.write(source[:2] + segment + source[2:])

Inspect changed.jpg. Look for a data hash failure in its report.

A fresh export from a photo editor may remove the manifest. If that happens, you may see the no-claim result.

Write Down Exactly What Passed

Save the original JPEG identifier and hash, the tool version, the settings used to determine trust, and the JSON and error files.

Report the manifest status, file binding, and signer trust in separate sentences or fields.

That makes it clear why two files that look alike can support different findings.

For the signed practice copy, your note could read as follows.

C2PA Tool 0.29.0 found an active manifest. The claim signature and data hash validated. The tool flagged the development signer as untrusted.

Try writing the equivalent note for the third copy using the observed validation results.

Was this page helpful?