reference-rust
The reference Rust crate for producing and verifying SignedReceipt envelopes.
- Crate
cloakapi-open-receipt- Version
- 0.1.0
- Rust
- 1.82 or later
- License
- Apache-2.0
- Status
- Not released on crates.io; no tarball or file manifest is published.
About
The crate has a receipt builder, JCS canonicalization per RFC 8785, ECDSA P-256 signing and verification (RustCrypto p256), and chain verification.
An optional fips feature signs with aws-lc-rs instead of p256. It does not enable the FIPS build of AWS-LC, so it does not by itself give you a FIPS 140-validated module.
Use it
Until a release exists, depend on the source by path.
Cargo.toml
# Not on crates.io yet — depend on the source by path:
[dependencies]
cloakapi-open-receipt = { path = "../open-receipt-rs" }
src/main.rs
use cloakapi_open_receipt::{discovery::verifying_key_from_pem, verify, SignedReceipt};
let signed: SignedReceipt = serde_json::from_slice(bytes)?;
let key = verifying_key_from_pem(PUBLIC_KEY_PEM)?;
let result = verify(&signed, &key);
Questions and patches
Bug reports, patches and security advisories go to open-source@cloakapi.io.