Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

c2pa-rs

> 编程语言
Open source

Rust SDK for the core C2PA (Coalition for Content Provenance and Authenticity) specification

375 stars0 likes1 views
WebsiteGitHub

About

Rust SDK for the core C2PA (Coalition for Content Provenance and Authenticity) specification

CAI Rust library

For information on support tiers for CI tests, see Support tiers for the CAI Rust SDK

Key features

The c2pa crate implements a subset of the C2PA technical specification and the CAWG identity assertion specification in the Rust programming language.

The library enables a desktop, mobile, or embedded application to:

  • Create and sign C2PA claims and manifests.
  • Create, sign, and validate CAWG identity assertions in C2PA manifests. See Using the CAWG identity assertion for more information.
  • Embed manifests in supported file formats.
  • Parse and validate manifests found in supported file formats.
  • Share configuration efficiently across multiple operations and threads through contexts using Arc.

The library supports several common C2PA assertions and hard bindings.

For details on what you can do with the library, see Using the Rust library.

This library also provides a C API that you can use to integrate with any application that uses C or interfaces with C libraries.

State of the project

This is a beta release (version 0.x.x) of the project. We govern changes by whether they break compatibility, not by size:

  • Additive changes (new APIs, bug fixes) ship quickly on the current release train as patch releases (the y in 0.x.y).
  • Breaking changes are batched onto a scheduled "release train" that runs roughly every two months and bumps the middle number (0.x.0). If no breaking changes are queued when a train is due, it is skipped, so a bump of the middle number is a reliable signal that something actually broke.

This lets us keep moving quickly before 1.0 while giving you a predictable schedule for migrations. For full details, see the release process and deprecation policy.

Which branch to use

  • main is the active development branch. It's always "green" (it compiles and passes CI), but its public API is not stable: it may contain unreleased or feature-gated work that changes at any time. It is also never published to crates.io. Build from main only if you want to preview upcoming work and can tolerate churn.
  • stable tracks the most recent crates.io release and is where published releases come from. Older v0.x branches are retained for retired release lines. If you depend on c2pa, use a released version from crates.io (which comes from stable) rather than pinning to main.

Every change lands on main first and is then brought onto stable for release, so main is always the superset of what has shipped.

[!NOTE] The library supports C2PA v2 claims by default, and implementations should not generate deprecated v1 claims. For details, see C2PA v2 claims.

New API

The current release API replaces old methods of reading and writing C2PA data, which are deprecated. See the release notes for more information.

Context API for configuration

The library uses a Context structure to configure C2PA operations, replacing the older global Settings pattern:

  • Thread-safe configuration: Context is Send + Sync and can be safely shared across threads using Arc
  • Multiple configurations: Unlike global settings, you can have multiple Context instances with different configurations
  • Backwards compatible: All existing Settings (JSON/TOML) files work unchanged with Context
  • Automatic signer creation: Signers are created automatically from settings when needed

See Configuring SDK settings for details.

Installation

Prerequisites

Install Rust and Cargo

To use the CAI Rust library, you must install Rust and Cargo.

Minimal supported Rust version (MSRV): The c2pa crate requires Rust version 1.96.0 or newer. When a newer version of Rust becomes required, a new minor (0.x.0) version of this crate will be released.

Install C build tools

Install the C build tools for your development platform:

  • macOS: Xcode with command-line tools
  • Windows: Microsoft Visual C++ (MSVC)

Build

The easiest way to build the library is by using the Makefile.

To build unit tests, use this command:

bash
make test

To build the binary libraries, use this command:

bash
make release

Add dependency

Add the following line to your Cargo.toml:

toml
c2pa = ""

Where `` is the latest version of the crate as shown on crates.io.

Contributions and feedback

We welcome contributions to this project. For information on contributing, providing feedback, and about ongoing work, see Contributing. For additional information on testing, see Contributing to the project.

License

The c2pa crate is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

Some components and dependent crates are licensed under different terms; please check their licenses for details.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustc2pametadata

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言