Skip to main content

OpenedEnvelope

Struct OpenedEnvelope 

Source
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: String

The typed Merkle root — the message’s content address (f1220<hex64>), which the v3 signature commits to.

§suite: SignatureSuite

Signature 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

Source

pub fn content_hash(&self) -> &str

The content address the v3 signature vouches for (f1220<hex64>).

Source

pub fn opening(&self, field: FieldId) -> Option<&Opening>

The opening for field, if this envelope discloses it.

Source

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.

Source

pub fn thread(&self) -> Option<&str>

Authenticated thread identifier, from the Thread opening (leaf 4).

Source

pub fn from_spelling(&self) -> Option<&str>

Authenticated sender spelling, from the From opening (leaf 1).

Source

pub fn to_spellings(&self) -> Option<Vec<&str>>

Authenticated recipient spellings, from the To opening (leaf 2).

Trait Implementations§

Source§

impl Clone for OpenedEnvelope

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OpenedEnvelope

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for OpenedEnvelope

Source§

impl PartialEq for OpenedEnvelope

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for OpenedEnvelope

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.