On this page
The open-source C2PA libraries
The reference implementation of C2PA is c2pa-rs, a Rust library maintained by the Content Authenticity Initiative. The other official SDKs are bindings over it, so they share its behaviour and its validation rules. The open-source documentation lists them all.
| Library | Package | Version on 5 December 2026 |
|---|---|---|
| c2pa-rs (Rust) | crate c2pa | 0.92.5 |
| c2pa-python | PyPI c2pa-python, Python 3.10 or later | 0.39.1 |
| c2pa-node | npm @contentauth/c2pa-node | 0.12.3 |
All three read manifests, validate them against a trust list you load, and build and sign new ones. They are free and released under open licences. tryVidimus signs every photo with the Node binding, so what follows is not a sales pitch against them: they are what we use.
Signing a photo with c2pa-python
With c2pa-python, signing comes down to three objects: a signer, a builder holding the manifest definition, and a call that writes the signed file. The callback signer is the important part: the library hands you the bytes to sign, and you return the signature, so the private key can live wherever you want. This is adapted from the example in the repository.
import c2pa
def sign_es256(data: bytes) -> bytes:
# Your key: a file in development, a KMS or HSM call in production
return my_key_service.sign(data)
manifest = {
"claim_generator_info": [{"name": "my-app", "version": "1.0.0"}],
"assertions": [{
"label": "c2pa.actions",
"data": {"actions": [{
"action": "c2pa.created",
"digitalSourceType": "http://cv.iptc.org/newscodes/digitalsourcetype/digitalCapture",
}]},
}],
}
with c2pa.Context() as context:
with c2pa.Signer.from_callback(
sign_es256,
c2pa.C2paSigningAlg.ES256,
cert_chain_pem, # your certificate chain
"https://your-tsa.example/", # RFC 3161 time-stamping authority
) as signer:
with c2pa.Builder(manifest, context) as builder:
builder.sign_file("in.jpg", "out.jpg", signer)That is all the library needs. It hashes the image, embeds the manifest in the JPEG, asks the time-stamping authority for a token and writes the result. The official example loads a test key from a file and says plainly that production needs a secure way to load keys. Everything that sentence implies is the rest of this article.
What you build around the call
Here is what we had to build around the same call in the Node binding, for photos that verifiers report as trusted. None of it is exotic. All of it is yours if you sign yourself.
- A key that never leaves its vault. Ours is in AWS Key Management Service, in Paris. KMS returns ECDSA signatures in DER, and the COSE signature inside a manifest wants the raw r and s values, so the callback converts them.
- A certificate request signed by that key, sent to a certificate authority on the C2PA trust list, then the certificate chain stored and loaded at signing time.
- A conformant listing, without which a listed authority will not issue the certificate. Our guide to the C2PA signing certificate walks through it.
- A time-stamping authority, retries when it is slow, and a rule for when it fails. Ours: two attempts, then the signing fails. We never write a less protected file than the one requested.
- A trust list loaded when reading incoming files, or every manifest that is merely valid looks as good as a trusted one.
- A native library in your build: the Node binding downloads a compiled binary at install time, which we pin by hash.
- A renewal every year, since the certificate lasts at most 366 days at assurance level 1.
const signer = c2pa.CallbackSigner.newSigner(
{
alg: 'es256',
certs: splitPemCertChain(certChainPem),
reserveSize: 20_000,
tsaUrl,
directCoseHandling: false,
},
// AWS KMS returns a DER signature; COSE wants raw r||s
async (data) => Buffer.from(derToRawEcdsa(await kmsSign(data))),
);
await builder.signAsync(signer, source, destination);The excerpt above is our signer, trimmed. The library call is one line; the conversion, the chain, the reserved space for the signature and the timestamp settings are the lines around it.
The part no library covers: capture
A library signs the file it is given. It cannot tell where that file came from. If your users upload photos from their gallery, you will sign, faithfully, a photo taken last year or edited before upload. For evidence, the question of origin comes before the question of signature.
That is the part tryVidimus adds: a capture page that takes the photo through the camera of the browser, never from the gallery, then the signed copy, a qualified eIDAS timestamp from Certigna on each proof, storage, and a public page where anyone can check the result. Our manifests record this as captureMethod browser-camera-input, and say deviceAttested false, because the phone itself does not vouch for the photo.
Which one fits your case
| Your situation | Library | API |
|---|---|---|
| Your company must appear as the signer | Yes: your listing, your certificate | No: the signer is our product |
| You sign files you generate yourself, on your servers | Yes, without a network call | Possible by direct upload through the API |
| Photos come from users' phones, inside your app | You build capture, storage and checks | Yes: capture page, seal and verification |
| You need a qualified timestamp for the date | You contract a qualified provider | Included on each proof |
| No conformance work, no key management | Not possible | Yes |
If you need full control, the libraries are excellent, and you now know the list. If you need photos from your users with a manifest that verifiers trust, the developer page shows the call and the first integration guide walks through it.
Frequently asked questions
What is c2pa-rs?
The reference implementation of the C2PA standard, a Rust library maintained by the Content Authenticity Initiative. It reads, validates, builds and signs manifests. The Python and Node SDKs are bindings over it.
Is there a Python library for C2PA?
Yes: c2pa-python, published on PyPI as c2pa-python and imported as c2pa. It requires Python 3.10 or later and wraps c2pa-rs, so it reads, validates and signs manifests.
Can c2pa-python sign with a key in a KMS or HSM?
Yes. A callback signer receives the bytes to sign and returns the signature, so the private key can stay in a key management service or hardware module. Check the signature format your service returns.
Do I need a certificate authority to sign with c2pa-rs?
To sign, no: a self-signed test certificate works and the manifest will be valid. For verifiers to report it as trusted, the certificate must come from an authority on the C2PA trust list, which requires a conformant listing.
When is a signing API a better choice than a library?
When the photos come from your users and you need capture, a trusted signature and a dated proof without running keys, certificates and conformance yourself. When your own name must appear as signer, use a library.
Try it in the sandbox
The C2PA libraries make signing a short call. The work is everything around it: the key, the certificate, the listing, the timestamp and, for evidence, the capture. You can try the API in the sandbox, without a card, and compare with your own build.
Create an accountOfficial 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.