tzap-plugin-keywrap
tzap-plugin-keywrap is the companion crate for v44-compliant RecipientWrap
workflows in documented supported tzap archives.
The crate provides HPKE recipient record generation, profile dispatch, X.509 recipient identity validation, and private-key lookup hooks for opening RecipientWrap archives.
Install
[]
= "0.1.9"
= "0.1.9"
Architecture
tzap-core owns the archive wire model and reader/writer surfaces. Projects
add this companion crate when they need v44 RecipientWrap records for
certificate-based archive access.
tzap-core archive format, recipient record wire types
tzap-plugin-keywrap HPKE seal/open logic and certificate identity checks
tzap CLI composes core plus keywrap plugin
The plugin keeps HPKE suite selection, X.509 recipient identity validation, and caller-owned private-key lookup outside the compact core crate.
Example
use ;
let archive_identity = default;
let recipient_certificate_der = include_bytes!;
let master_key = ;
let record = wrap_master_key_for_recipient?;
assert_eq!;
# Ok::
For opening RecipientWrap archives, callers implement PrivateKeyLookup and
pass RecipientRecordInput values to dispatch_key_wrap_record. Successful
dispatch returns KeyWrapOutcome::UnwrappedCandidateMasterKey.
Supported Suites
The v44 key-wrap profile supports:
KeyWrapSuite::X25519HkdfSha256ChaCha20Poly1305KeyWrapSuite::P256HkdfSha256Aes256Gcm
Recipient identities are DER-encoded X.509 leaf certificates
(KEYWRAP_RECIPIENT_IDENTITY_TYPE_BYTES = 2). Certificate acceptance policy is
caller-owned through PrivateKeyLookup::is_recipient_certificate_accepted.
More Information
- Repository: https://github.com/tzap-org/tzap
- Core crate: https://crates.io/crates/tzap-core
- CLI crate: https://crates.io/crates/tzap
- Implemented format specification: https://github.com/tzap-org/tzap/blob/main/specs/tzap-format-revisedv44.md
- v44 RecipientWrap spec: https://github.com/tzap-org/tzap/blob/main/specs/plugin/tzap-plugin-keywrap-v1-proposed-v44.md