C2PA Rust SDK

CI Latest Version docs.rs codecov

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. Adobe and other contributors created the C2PA Rust SDK as part of the Content Authenticity Initiative and released it to open source in June, 2022.

Key features

The C2PA Rust SDK implements a subset of the C2PA 1.2 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.

State of the project

This is a beta release (version 0.x.x) of the project. The minor version number (0.x.0) is incremented when there are breaking API changes, which may happen frequently.

Contributions and feedback

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

Requirements

The SDK requires Rust version 1.65.0 or newer.

Supported platforms

The SDK has been tested on the following operating systems:

Supported file formats

| Extensions | MIME type | | ------------- | --------------------------------------------------- | | avi | video/msvideo, video/avi, application-msvideo | | avif | image/avif | | c2pa | application/x-c2pa-manifest-store, | | dng | image/x-adobe-dng | | heic | image/heic | | heif | image/heif | | jpg, jpeg | image/jpeg | | m4a | audio/mp4 | | mp4 | video/mp4, application/mp4 | | mov | video/quicktime | | png | image/png | | tif,tiff | image/tiff | | wav | audio/x-wav | | webp | image/webp |

Usage

Add this to your Cargo.toml:

toml [dependencies] c2pa = "0.24.0"

If you want to read or write a manifest file, add the file_io dependency to your Cargo.toml. For example: c2pa = { version = "0.19.0", features = ["file_io"] }

NOTE: If you are building for WASM, omit the file_io dependency.

Crate features

The Rust SDK crate provides:

License

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.

Release Notes

This section gives a highlight of noteworthy changes

Refer to the CHANGELOG for detailed Git changes

0.24.0

21 June 2023 * Bump minor version to 0.24.0 to signify change in signature (back to the compatible one) * Reverts to 1.2 Cose signatures when signing while still validating 1.3 Cose signatures * We want to allow some time for clients to upgrade to validating 1.3 before writing this breaking change. * Fix embedfrommemory to correctly return the updated image * includes the cert serial number in the ValidationInfo output * support adding claimgeneratorinfo field * support Actions V2 and Ingredients V2 * BMFF V2 * Json Schema generation

0.19.0

23 March 2023