Crate c2pa_crypto

Source
Expand description

§C2PA cryptography implementation

CI Latest Version docs.rs [codecov

This crate contains some of the internal cryptography implementation that is shared between the c2pa crate and the CAWG identity SDK crate. It is not intended to be used directly in most cases.

§Crate features

This crate has two features, neither of which are enabled by default:

  • json_schema: Used by c2pa-rs documentation code to generate JSON schema for types defined in this crate.
  • rust_native_crypto: Where available, prefer Rust-native cryptography libraries for raw signature and validation implementations. (Experimental)

§Cryptographic library support

c2pa-crypto will use different cryptography libraries depending on which platform and feature flags are used:

§Signing (synchronous or asynchronous)

C2PA SigningAlgDefault (*)feature = "rust_native_crypto" (*)WASM
es256OpenSSLOpenSSL
es384OpenSSLOpenSSL
es512OpenSSLOpenSSL
ed25519OpenSSLed25519-daleked25519-dalek
ps256OpenSSLrsarsa
ps384OpenSSLrsarsa
ps512OpenSSLrsarsa

(*) Applies to all supported platforms except WASM
❌ = not supported

§Validation (synchronous)

C2PA SigningAlgDefault (*)feature = "rust_native_crypto" (*)WASM
es256OpenSSLOpenSSLp256
es384OpenSSLOpenSSLp384
es512OpenSSLOpenSSL
ed25519OpenSSLed25519-daleked25519-dalek
ps256OpenSSLrsarsa
ps384OpenSSLrsarsa
ps512OpenSSLrsarsa

(*) Applies to all supported platforms except WASM
❌ = not supported

§Validation (asynchronous)

C2PA SigningAlgDefault (*)feature = "rust_native_crypto" (*)WASM
es256OpenSSLOpenSSLWebCrypto
es384OpenSSLOpenSSLWebCrypto
es512OpenSSLOpenSSLWebCrypto
ed25519OpenSSLed25519-daleked25519-dalek
ps256OpenSSLrsarsa
ps384OpenSSLrsarsa
ps512OpenSSLrsarsa

(*) Applies to all supported platforms except WASM

§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 nightly builds and testing, see Contributing to the project.

§License

The c2pa-crypto 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.

Modules§

base64
Base64 convenience functions.
cose
This module provides functions for working with COSE signatures.
hash
Hash convenience functions.
ocsp
Tools for working with OCSP responses.
raw_signature
Tools for working with raw signature algorithms.
time_stamp
Functions for working with RFC 3161 time stamp service providers.