Skip to content

contentauth/c2pa-rs

Repository files navigation

C2PA Rust library

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. The C2PA Rust library is part of the Content Authenticity Initiative open-source SDK.

For the best experience, read the docs on the CAI Open Source SDK documentation website.

You can also read the documentation directly in GitHub:

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:

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.

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.

NOTE: The library now supports C2PA v2 claims, however development is still in progress and all features are not fully implemented yet. While you can experiment with this functionality, it is not recommended for production use at this time. For details, see C2PA v2 claims.

New API

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

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.82.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 platoform"

  • 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:

make test

To build the binary libraries, use this command:

make release

Add dependency

Add the following line to your Cargo.toml:

c2pa = "<VERSION_NUMBER>"

Where <VERSION_NUMBER> 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.

About

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

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Languages