Skip to content
Developers7 min read

How to Verify a Sealed Photo Programmatically

To verify photo authenticity programmatically, fetch the public bundle of the proof, recompute the SHA-256 fingerprint of the file you hold, and check the RFC 3161 timestamp token. The open-source verifier does it without trusting our servers.

By Cédric Driaux, Founder of tryVidimus

Drawing of a terminal with a check mark

What gets verified

A proof that only its issuer can confirm is still the issuer's word. This article shows how to verify photo authenticity programmatically, with data anyone can fetch and tools anyone can run. It belongs to our developer guide to the photo evidence API.

A sealed proof from tryVidimus makes three claims that software can check. Each one has its own piece of data.

ClaimDataHow to check it
The file is the one that was sealedThe signed_sha256 fingerprint of each fileRecompute the SHA-256 of the copy you hold and compare.
The proof existed at a certified timeThe RFC 3161 timestamp token (tsr_base64) and manifest_sha256Check the token against the certificate chain of the timestamp authority.
The photo carries its originThe C2PA manifest embedded in the signed copy (manifest_id)Read the Content Credentials of the file with a C2PA tool.

The first two are plain cryptography: a hash and a signed token. The third relies on C2PA, the open standard behind Content Credentials.

The public verification bundle

Every sealed proof has a public bundle. The route needs no API key: the identifier of the proof is enough. It returns what independent software needs. It does not contain your booking or order reference in clear, nor the photos.

curl -s https://api.tryvidimus.com/v1/public/proofs/prf_01m4akapdbe8e8qq3er9r5qwyj/bundle > bundle.json
{
  "version": 1,
  "proof_id": "prf_01m4akapdbe8e8qq3er9r5qwyj",
  "mode": "live",
  "capture": { "method": "hosted_live", "session_id": "cps_…" },
  "media": [
    {
      "captured_at": "…",
      "original_sha256": "…",
      "signed_sha256": "…",
      "manifest_id": "…",
      "key_version": "…"
    }
  ],
  "manifest_sha256": "…",
  "timestamp": {
    "mode": "direct",
    "tsr_base64": "…",
    "authority": "…",
    "qualified": true,
    "gen_time": "…",
    "serial": "…",
    "policy_oid": "…"
  },
  "batch": null
}

The example is abridged. A few fields deserve attention before you write code.

  • mode is live or test. In test mode the timestamp is simulated and has no legal value: reject test proofs in any real workflow.
  • manifest_sha256 is the hash of the manifest that describes the proof. In the default direct mode, the timestamp token certifies this value.
  • gen_time is the time certified by the authority: the proof existed at the latest at that time. It is not the time of capture.
  • captured_at is the time our service observed the file. It is not a qualified timestamp.
  • qualified is declared by the service. A verifier recomputes it and never trusts this field.
  • The external reference is never public. The bundle carries a cryptographic commitment to it instead.

A proof that exists but is not sealed yet answers 409 proof_not_sealed. The bundle also has a batch field, for proofs timestamped in a batch with a Merkle path. That mode is off by default, and the verifier handles it.

Using the open-source verifier

The verifier is open source, under the MIT licence, and published on npm. It recomputes the fingerprints and checks the timestamp on its own, from the public bundle. You can read its code before you trust its answer.

npm install @tryvidimus/verifier

The package needs Node.js 22 or later. Its building blocks are published separately: SHA-256, canonical JSON, Merkle tree and RFC 3161 timestamps. The entry points and their options are described in the repository and in the documentation, which remain the reference.

Three other paths run the same verification without writing code against the library:

  • The public verification page of the proof, for a person who only has a link.
  • The command line, which can verify a sealed proof locally, from a terminal or in CI.
  • The MCP server, whose verify_proof tool lets an assistant such as Claude run the check from a conversation.

In an automated workflow, treat verification as a gate. A claims tool, for example, can refuse to attach a photo to a file unless the proof is sealed, in live mode, with a fingerprint that matches the copy it received.

Verifying without trusting us

The strongest check uses no code of ours at all. You need the signed copy of the photo, the bundle, and two standard tools: a SHA-256 utility and OpenSSL.

First, the file. The platform that created the proof downloads the signed copy through a temporary access link, with its API key, and gives it to you. Compute its fingerprint and compare it with signed_sha256 in the bundle.

shasum -a 256 photo.jpg
jq -r '.media[].signed_sha256' bundle.json

If the two values differ, even by one character, the file is not the one that was sealed. Then the date. Decode the timestamp token from the bundle and ask OpenSSL to verify it against manifest_sha256.

jq -r '.timestamp.tsr_base64' bundle.json | base64 --decode > proof.tsr

openssl ts -verify \
  -digest "$(jq -r '.manifest_sha256' bundle.json)" \
  -in proof.tsr -CAfile chain.pem

The chain.pem file is the certificate chain of the timestamp authority. Get it from the authority itself, not from us: that is the point of an independent third party. In production the authority is Certigna, a French qualified trust service provider, and qualified providers appear on the European trusted list.

The token follows RFC 3161: the authority received a fingerprint, never the photos, and signed it with a date. Our article on RFC 3161 timestamping for developers explains the format and the checks in detail.

Last, the origin. Each signed copy embeds a C2PA manifest, which Content Credentials tools can read. tryVidimus is a C2PA conformant generator product for JPEG photos, at assurance level 1.

Common pitfalls when you automate verification

  • Hashing the wrong file. A photo that went through a messaging app or an image resizer is a new file. Hash the signed copy, byte for byte.
  • Storing the access link. The link to a signed copy is temporary. Download the bytes right away and keep the file, not the link.
  • Reading captured_at as the certified date. Only gen_time comes from the authority.
  • Accepting test proofs. Check mode before anything else.
  • Trusting fields you did not verify. The status and the qualified flag are statements of the service. The hash and the token are what you can check yourself.
  • Calling the public routes in a tight loop. They are limited per IP address: fetch a bundle once and keep it with the file.

If you have not sealed a proof yet, start with the tutorial that adds sealed capture to an app in four steps. It ends where this article begins: with a proof identifier and a verification link.

Frequently asked questions

Do I need an API key to verify a proof?

No. The public status of a proof and its verification bundle are served without a key: the identifier of the proof is enough. A key is only needed to download the signed copy of a photo, and that is the job of the platform that created the proof. The public routes never return the files or the external reference.

Can I verify a proof if your service is offline or gone?

Yes, provided you kept two things: the signed copy of the photo and the bundle of the proof. The fingerprint is recomputed locally, and the timestamp token is checked with OpenSSL against the certificate chain of the timestamp authority. Neither step calls our servers. Keep the bundle next to each photo for that reason.

What is the difference between captured_at and gen_time?

captured_at is the time our service observed the file, and it is not qualified. gen_time is the time certified by the timestamp authority: the proof existed at the latest at that moment. In production the timestamp is a qualified one under eIDAS, given to the second, and gen_time is the only date in the proof that an independent authority certifies. Use it, not captured_at, whenever a date matters.

Does a valid result prove the photo is true?

No. A valid result shows that the file is the one that was sealed, that it existed at the certified time and that it came from a live capture. It says nothing about whether the scene is truthful or who held the phone. Weighing what the photo shows stays with the parties, an insurer or a judge.

How do I verify a proof made in test mode?

The same way, and the result says test mode. The bundle and the public status both carry a mode field, and in test mode the authority is reported as simulated. A simulated timestamp has no legal value, so your code should refuse test proofs wherever a real one is expected.

Try it in the sandbox

To verify photo authenticity programmatically, you need a public bundle, a hash and a timestamp token, not our word. The verifier is open source, and OpenSSL checks the date without us. You can seal a first proof and run these checks for free in the sandbox, without a card.

Create an account

Official sources

Cédric Driaux · Founder of tryVidimus

Cédric Driaux is the founder of tryVidimus, published by Fyher. He has been a software developer for 23 years. He also builds ScanStay, a photo proof tool for short-term rental hosts.

Related articles