The Coalition for Content Provenance and Authenticity (C2PA) addresses the prevalence of misleading information online through the development of technical standards for certifying the source and history (or provenance) of media content. The C2PA Rust SDK was created by Adobe and other contributors as part of the Content Authenticity Initiative and released to open source in June, 2022.
The C2PA Rust SDK implements a subset of the C2PA 1.0 technical specification.
The SDK enables a desktop, mobile, or embedded application to: * Create and sign C2PA claims and manifests. * Embed manifests in certain file formats. * Parse and validate manifests found in certain file formats.
The SDK supports several common C2PA assertions and hard bindings.
This project is an early pre-release version and has unimplemented features and may have outstanding issues or bugs. While in prerelease form, the minor version number (0.x.0) will be incremented when there are breaking API changes, which may happen frequently.
The SDK: * Currently supports only still image formats (JPEG and PNG). * Does not parse identity structures (verifiable credentials).
We welcome contributions to this project. For information on contributing, providing feedback, and about ongoing work, see Contributing.
The SDK requires Rust version 1.58.0 or newer.
The SDK has been tested on the following operating systems:
Add this to your Cargo.toml
:
toml
[dependencies]
c2pa = "0.11.3"
If you want to read or write a manifest file, add the file_io
dependency to your Cargo.toml
, for example:
c2pa = {version="0.11.0", features=["file_io"]}
NOTE: If you are building for WASM. omit the file_io
dependency.
The Rust SDK crate provides:
async_signer
enables signing via asynchronous services which require async
support.bmff
enables handling of ISO base media file formats (BMFF) used for video. Currently only MP4, M4A, and MOV are enabled for writing.file_io
enables manifest generation, signing via OpenSSL, and embedding manifests in various file formats.serialize_thumbnails
includes binary thumbnail data in the Serde serialization output.xmp_write
enables updating XMP on embed with the dcterms:provenance
field. (Requires xmp_toolkit.)no_interleaved_io
forces fully-synchronous I/O; Otherwise, the SDK uses threaded I/O for some operations to improve performance.The c2pa
crate is distributed under the terms of both the MIT license and the Apache License (Version 2.0).
Note that some components and dependent crates are licensed under different terms; please check the license terms for each crate and component for details.