c2pa-rs: what the C2PA Rust library is, and how to read Content Credentials with it
Short answer: c2pa-rs is the official open-source Rust library for C2PA, the standard behind Content Credentials. It's maintained by the Content Authenticity Initiative (CAI) on GitHub as contentauth/c2pa-rs and published to crates.io as the c2pa crate. It can read and validate a file's C2PA manifest, and create, sign and embed new ones. It's dual-licensed MIT and Apache 2.0, and still labelled beta.
If you only want to inspect a file, you probably don't need the library at all: the c2patool command-line tool is built on it and does the job in one command.
Most results for this search are the GitHub repo itself, mirrors of it, and docs.rs pages for old versions. Several show snippets from 0.25 or 0.32 and install steps the project has since dropped. None of them tell you which piece of the project to pick, or what a "valid" result actually proves. This page covers both, as of November 2026.
What's in the c2pa-rs project
According to the project's README and the CAI's GitHub organisation:
- The
c2pacrate is the Rust SDK. The README says it "implements a subset of the C2PA technical specification and the CAWG identity assertion specification". - A C API (
c2pa_c_ffi) lives in the same repo, for apps that talk to C libraries. - c2patool, the command-line tool, used to live in this repo but now has its own (
contentauth/c2patool). - Language bindings are separate repos built on the Rust core:
c2pa-python(described as a "Python binding for c2pa-rs library"),c2pa-cpp,c2pa-js, and mobile SDKsc2pa-swiftandc2pa-android.
So "c2pa rs" is the engine. Most people meet it through one of the wrappers.
Version and stability
- docs.rs lists c2pa 0.92.2, published 16 November 2026. Check docs.rs or crates.io for the current number, because it moves fast.
- The README calls it "a beta release (version 0.x.x)". Breaking changes are batched into a release train that runs roughly every two months and bumps the middle number. Patch releases are additive.
- The
mainbranch is never published. Depend on a crates.io release, not on git. - It needs Rust 1.96.0 or newer.
- It writes C2PA v2 claims by default, and the docs say new implementations shouldn't generate the deprecated v1 claims.
- The older read/write methods are deprecated in favour of what the README calls the "New API", in which a
Contextreplaces the old global settings. Tutorials written before this switch won't compile cleanly against current releases.
Which file formats it handles
The project's supported-formats list includes JPEG, PNG, WebP, GIF, TIFF, AVIF, HEIC/HEIF, JPEG XL, DNG, SVG, MP4, MOV, AVI, MP3, M4A, WAV, FLAC and PDF, plus standalone .c2pa manifest-store files. Sony ARW and Nikon NEF are read-only. Plain text needs an unstable feature flag.
Reading a manifest from Rust
Add the crate to Cargo.toml:
[dependencies]
c2pa = "0.92"
The crate's own documentation shows reading a manifest like this:
use c2pa::{assertions::Actions, Reader};
let stream = std::fs::File::open("tests/fixtures/C.jpg")?;
let reader = Reader::default().with_stream("image/jpeg", stream)?;
println!("{}", reader.json());
if let Some(manifest) = reader.active_manifest() {
let actions: Actions = manifest.find_assertion(Actions::LABEL)?;
for action in actions.actions {
println!("{}\n", action.action());
}
}
reader.json() gives you the whole manifest store as JSON. The active manifest is the most recent one, the record of the last signed change. Its c2pa.actions assertion lists what was done to the file, for example c2pa.created or c2pa.edited, which is where AI generators record that they made the image.
Without a trust list, "valid" only means intact. To check the signer against the official C2PA trust list, the docs show building a Context with settings whose trust.trust_anchors value holds the PEM contents of that list, then creating the reader with Reader::from_context(context). Skip that and you can learn that a manifest is well-formed and unmodified, but not whether anyone you'd recognise signed it.
Feature flags worth knowing
From the crate docs:
openssl(on by default) orrust_native_cryptopicks the crypto backend. One of them must be on.file_ioenables the filesystem convenience APIs.fetch_remote_manifestslets the reader fetch a manifest over the network when the file only points to one, if settings allow it.add_thumbnailspulls in theimagecrate for auto-generated thumbnails when signing.pdfenables basic PDF reading.- For WebAssembly, the only supported HTTP feature is
http_reqwest, so network calls go through the async API.
Signing with c2pa-rs, briefly
Writing is done with a Builder: you give it a manifest definition, add assertions and ingredients, and call a save method that signs and embeds the result. The signer is built from settings on the Context, or you supply your own through the Signer trait. The crate also ships callback, async and ephemeral signer types for keys that aren't simply a file on disk.
The part tutorials gloss over: a signature only means something to a validator if the certificate chains to a trust anchor it accepts. Signing with a test certificate produces a manifest that checkers report as untrusted. Getting onto the official trust list is a separate process from writing the code.
When c2patool is enough
If your goal is "what's in this file?", use the CLI instead of writing Rust. Per its README and usage docs:
- Install:
brew install c2patoolon macOS, or download a prebuilt binary for macOS, Windows or Linux from the repo's Releases page and put it on your PATH. The project removed itscargo binstallinstructions in 2025, so older guides recommending that are out of date. - Read:
c2patool photo.jpgprints the manifest store as JSON. - Summary:
c2patool photo.jpg --infoshows the manifest store's size, how many manifests it holds, and whether it validated. - Full detail:
c2patool photo.jpg -dprints the low-level C2PA data. - Check against the official trust list:
c2patool photo.jpg trust --trust_anchors='https://raw.githubusercontent.com/c2pa-org/conformance-public/refs/heads/main/trust-list/C2PA-TRUST-LIST.pem'
Or run c2patool init trust once to cache the list locally so every later command checks against it. If the signer isn't on the list, the output includes a validation_status entry such as signingCredential.untrusted.
For a quick look without installing anything, the CAI's Verify website does the same kind of check in a browser.
What c2pa-rs can't tell you, and what our tools don't do
It can only read what's there. If a platform re-encoded the image or someone stripped its metadata, there's no manifest to find and c2pa-rs reports nothing. Absence isn't evidence of anything. Our post on which platforms strip metadata covers how common that is.
Valid doesn't mean true. A trusted manifest proves the record is intact and who signed it. It doesn't prove the scene was real or that the signer was honest. The C2PA standard explainer goes into those limits.
It doesn't see watermarks. Invisible watermarks such as SynthID live in the pixels, not in the manifest. A manifest may say a watermark was applied, but c2pa-rs doesn't detect one.
Our checker isn't a validator. The content credentials checker runs in your browser and scans the file for C2PA markers such as c2pa.claim and c2pa.signature. It tells you whether a manifest is present. It doesn't parse the manifest or verify the signature. For that, use c2patool or the library.
Our remover takes the manifest out, not the history. The C2PA remover redraws images on a canvas in your browser, which drops C2PA along with EXIF, XMP and IPTC, and nothing is uploaded. It accepts JPEG, PNG and WebP, and JPEG output is re-encoded at quality 0.95, so the pixels aren't bit-identical. It can't remove a watermark in the pixels or a copy of the manifest the creator stored online. A file without metadata also isn't anonymous: the platform still knows which account posted it.
For the bigger picture of what a manifest records and why it matters for privacy, start with the Content Credentials explainer.
Questions people ask
Is c2pa-rs the same as c2patool? No. c2pa-rs is the library. c2patool is a command-line program built on it, now kept in its own repository.
Who makes c2pa-rs? Adobe and other contributors created it as part of the Content Authenticity Initiative, which publishes it under the contentauth GitHub organisation.
Is c2pa-rs free for commercial use? It's dual-licensed under MIT and Apache 2.0. The README notes that some components and dependencies have their own terms, so check those for your build.
Is it production-ready? The project still calls itself beta and makes breaking changes on a roughly two-month cycle. Pin a version and expect to update code when you upgrade.
Can I use it from Python or JavaScript? Yes, through the CAI's bindings: c2pa-python, c2pa-js, plus C++, Swift and Android SDKs, all built on the Rust core.
Does c2pa-rs detect AI images? Only if the file carries a manifest saying so. It reads what the generator or editor recorded; it doesn't analyse pixels. See how to check if an image is AI-generated for other signals.