5 unstable releases
new 0.3.0 | Jan 16, 2025 |
---|---|
0.2.0 | Dec 12, 2024 |
0.1.2 | Oct 25, 2024 |
0.1.1 | Oct 24, 2024 |
0.1.0 | Oct 24, 2024 |
#513 in Cryptography
408 downloads per month
Used in 3 crates
460KB
8K
SLoC
C2PA cryptography implementation
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 SigningAlg |
Default (*) | feature = "rust_native_crypto" (*) |
WASM |
---|---|---|---|
es256 |
OpenSSL | OpenSSL | ❌ |
es384 |
OpenSSL | OpenSSL | ❌ |
es512 |
OpenSSL | OpenSSL | ❌ |
ed25519 |
OpenSSL | ed25519-dalek |
ed25519-dalek |
ps256 |
OpenSSL | rsa |
rsa |
ps384 |
OpenSSL | rsa |
rsa |
ps512 |
OpenSSL | rsa |
rsa |
(*) Applies to all supported platforms except WASM
❌ = not supported
Validation (synchronous)
C2PA SigningAlg |
Default (*) | feature = "rust_native_crypto" (*) |
WASM |
---|---|---|---|
es256 |
OpenSSL | OpenSSL | p256 |
es384 |
OpenSSL | OpenSSL | p384 |
es512 |
OpenSSL | OpenSSL | ❌ |
ed25519 |
OpenSSL | ed25519-dalek |
ed25519-dalek |
ps256 |
OpenSSL | rsa |
rsa |
ps384 |
OpenSSL | rsa |
rsa |
ps512 |
OpenSSL | rsa |
rsa |
(*) Applies to all supported platforms except WASM
❌ = not supported
Validation (asynchronous)
C2PA SigningAlg |
Default (*) | feature = "rust_native_crypto" (*) |
WASM |
---|---|---|---|
es256 |
OpenSSL | OpenSSL | WebCrypto |
es384 |
OpenSSL | OpenSSL | WebCrypto |
es512 |
OpenSSL | OpenSSL | WebCrypto |
ed25519 |
OpenSSL | ed25519-dalek |
ed25519-dalek |
ps256 |
OpenSSL | rsa |
rsa |
ps384 |
OpenSSL | rsa |
rsa |
ps512 |
OpenSSL | rsa |
rsa |
(*) 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.
Dependencies
~18–30MB
~567K SLoC