pub struct OpenedEnvelope {
pub root: String,
pub suite: SignatureSuite,
pub signature: Vec<u8>,
pub openings: Vec<Opening>,
}Expand description
An opened envelope (SPEC-017 REQ-813): the typed content address
(root), a v3 root-signature over it, and a set of authenticated
field-openings against that root.
This is the Stage-3 successor to RedactedEnvelope. Where a redacted
envelope reconstructs a header and re-binds it with a v2 attestation,
an opened envelope carries each header field as a self-authenticating
Opening of the same Merkle root the single v3 signature vouches for
(crate::attest::sign_attestation_v3): the header authentication is
now the content address’s own read-out, not a separate signed object.
Redacted delivery opens leaves 0–4 (the HEADER_FIELDS) and seals
leaf 5, so a widened recipient learns the predecessor’s type, endpoints,
causal position and thread at zero payload disclosure (NFR-701). Opening
the payload leaf as well is the full-content path a completion decider
needs ([[SPEC-015 REQ-703]]); an opened envelope built for redacted
delivery deliberately omits it, preserving the safety/completion boundary.
Constant size: each opening is a fixed ≤3-sibling path (NFR-700), so the envelope is bounded by the header-field count, independent of the redacted payload.
Trust: root, suite, and the opening values are claims until
verify_opened succeeds; after that, the v3 signature vouches for the
root and every opening authenticates a field value against it. Any party
can forward a genuine opened envelope; only the signer can produce one
(the v3 signature needs the private key), and forging any field fails
verify_opened.
Fields§
§root: StringThe typed Merkle root — the message’s content address
(f1220<hex64>), which the v3 signature commits to.
suite: SignatureSuiteSignature suite named in the v3 attestation preimage (REQ-708): a v3 signature can never be re-read under a different suite.
signature: Vec<u8>v3 root-signature over (cbcl-attest-v3 <suite> <root>) (REQ-812).
openings: Vec<Opening>Authenticated field-openings against root. For redacted delivery
these are the HEADER_FIELDS; the payload leaf is absent.
Implementations§
Source§impl OpenedEnvelope
impl OpenedEnvelope
Sourcepub fn content_hash(&self) -> &str
pub fn content_hash(&self) -> &str
The content address the v3 signature vouches for (f1220<hex64>).
Sourcepub fn opening(&self, field: FieldId) -> Option<&Opening>
pub fn opening(&self, field: FieldId) -> Option<&Opening>
The opening for field, if this envelope discloses it.
Sourcepub fn performative(&self) -> Option<&str>
pub fn performative(&self) -> Option<&str>
Authenticated performative type, from the Performative opening
(leaf 0). None if that leaf is not opened or is malformed.
Sourcepub fn thread(&self) -> Option<&str>
pub fn thread(&self) -> Option<&str>
Authenticated thread identifier, from the Thread opening (leaf 4).
Sourcepub fn from_spelling(&self) -> Option<&str>
pub fn from_spelling(&self) -> Option<&str>
Authenticated sender spelling, from the From opening (leaf 1).
Sourcepub fn to_spellings(&self) -> Option<Vec<&str>>
pub fn to_spellings(&self) -> Option<Vec<&str>>
Authenticated recipient spellings, from the To opening (leaf 2).