Need to comply with the EU AI Act by 2 December 2026? New users can start with Trufo's AI Labeling Service or C2PA Certificates with your first month free.

New users: AI Labeling Service or C2PA Certificates, first month free.

Guides

6. Timestamps and OCSP

Add RFC 3161 timestamps from Trufo Timestamp Authority (TSA) and stapled Online Certificate Status Protocol (OCSP) responses to an in-house C2PA signer (c2pa-rs, c2patool, camera firmware, or custom software). This guide applies whether your signing certificates come from Trufo CA (5. C2PA Certificates, 7. CAWG Identity) or from another CA. If Trufo signs for you (Managed Signing), Trufo handles both automatically.

An RFC 3161 timestamp proves the signature was created while the signing certificate was valid, so the asset stays verifiable after the certificate expires (long-term validation / LTV). A stapled OCSP response embeds the certificate’s revocation status at signing time, so validators do not depend on a live OCSP lookup later. You can use Trufo TSA with a certificate from any CA without Organization Validation; OCSP must come from the CA that issued your certificate.


1. Wire Your Signer to the Test TSA

https://test.tsa.trufo.ai/ is free and needs no account or API key.

  • It signs with a self-signed test certificate outside TCA Test Root CA, so c2pa-rs reports timeStamp.untrusted unless you relax timestamp trust in your test settings (Verification). Use it only for test assets (such as Trufo dummy and Test Flow certificates).
  • https://test.tsa.trufo.ai/api-key returns the same response but requires the literal header X-API-Key: test-api-key-header (401 otherwise). Point your signer here to confirm it sends the header before you switch to production.

Run a quick smoke test against the test TSA (verifying both reachability and header wiring):

printf 'hello trufo\n' > sample.txt
openssl ts -query -data sample.txt -sha256 -cert -no_nonce -out request.tsq
curl -fsS -X POST https://test.tsa.trufo.ai/api-key \
  -H "Content-Type: application/timestamp-query" \
  -H "X-API-Key: test-api-key-header" \
  --data-binary @request.tsq -o response.tsr
openssl ts -reply -in response.tsr -text

Checkpoint: the reply should report Status: Granted. and a Policy OID: of 1.3.6.1.4.1.62524.2.1.


2. Set Up the Production TSA

Prerequisites

  1. Trufo account with MFA (2. Trufo Account Setup). Organization Validation (OV) is not required for TSA alone.
  2. Active C2PA TSA plan (c2pa_tsa_api).
  3. An API key with the tsa scope, stored with trufo set-api-key tsa <key> or TRUFO_TSA_API_KEY. Keep it on backend infrastructure, not in client apps or device firmware (2. Trufo Account Setup).

The shared endpoint is https://tsa.trufo.ai/. For high sustained throughput or regional requirements (for example, a dedicated EU endpoint), contact support@trufo.ai about a dedicated https://{host}.tsa.trufo.ai/ endpoint.

Send requests

POST a DER TimeStampReq to https://tsa.trufo.ai/ with Content-Type: application/timestamp-query and X-API-Key: tsa:<key> (the full key, including the tsa: prefix). The unauthenticated GET /policy returns the policy OID and accepted digests. Limits and error codes are in Timestamp Authority (RFC 3161).

Wire it into your signer

  • c2pa-rs: wrap your Signer (or AsyncSigner) so that time_authority_url() returns https://tsa.trufo.ai/ and timestamp_request_headers() returns the X-API-Key header. The full wrapper, which also serves OCSP, is in With c2pa-rs.
  • c2patool, C FFI, and other clients without custom headers: run a private reverse proxy that adds the header, and set the client’s TSA URL to http://<internal-proxy-host>/tsa/ (the trailing slash matters). Do not expose the proxy publicly. See With c2patool or clients without custom headers.
location /tsa/ {
    proxy_pass https://tsa.trufo.ai/;
    proxy_ssl_server_name on;  # sends SNI for tsa.trufo.ai
    proxy_set_header X-API-Key "<YOUR_TSA_API_KEY>";
}

3. Staple OCSP Responses

https://ocsp.trufo.ai covers certificates issued by Trufo CA only. If you use Trufo TSA with another CA’s certificate, fetch OCSP from that CA, or do not staple.

Requests are unauthenticated (POST with Content-Type: application/ocsp-request, or GET /{base64_request}). Operational rules:

  • Use the issuer-pinned path for the certificate’s direct issuing CA: /c2pa for c2pa-l1 and c2pa-l2, /cawg for cawg-interim. https://test.ocsp.trufo.ai serves /c2pa only, for Test Flow certificates.
  • Each response is valid for 7 days (thisUpdate to nextUpdate); the responder refreshes its revocation cache about every 60 seconds.
  • Cache one response per active leaf certificate and refresh it on a schedule well before nextUpdate (for example, every 12–24 hours), and immediately after rotating or revoking a certificate. Never fetch per signature.

Endpoint and response details are in OCSP Responder (RFC 6960).

Wire it into c2pa-rs

In the same Signer wrapper, return None from ocsp_val() until the first response is fetched, never an empty slice, and add 16 KB headroom in reserve_size() to avoid a COSE buffer overflow. See With c2pa-rs.


4. Verify End to End

Three checks confirm the setup:

  1. Timestamp: a token from the TSA verifies with openssl ts against the C2PA Timestamping CA (CTSA) chain.
  2. OCSP: openssl ocsp reports your leaf certificate as good, after you convert the downloaded DER .crt issuer and root files to PEM.
  3. Signed asset: a test file signed by your signer, inspected at verify.trufo.ai or with the c2pa-rs Reader, shows a trusted timestamp and the stapled OCSP status.

The commands for the first two checks are in Timestamping and OCSP, and the third in Verification.


Next Steps

Reference