Skip to main content

RedactedEnvelope

Struct RedactedEnvelope 

Source
pub struct RedactedEnvelope {
    pub header: AttestationHeader,
    pub signature: Vec<u8>,
}
Expand description

A redacted envelope (REQ-700): the authenticated header of a signed message plus the R4 v2 signature over that header’s attestation preimage — and nothing else. Its size is bounded by role-set size and :caused-by arity, independent of the redacted payload (NFR-700).

Field trustworthiness: the header fields are claims until RedactedEnvelope::verify succeeds; after that, every field is exactly what the sender’s key vouched for (REQ-701). Store acceptance goes through ThreadedMessageStore::append_envelope, which verifies first and places the envelope in the thread its authenticated thread field names (REQ-702).

Fields§

§header: AttestationHeader

The authenticated header: content hash, performative, sender key, recipient set, thread, :caused-by — the exact fields the v2 attestation preimage commits to (ADR-700).

§signature: Vec<u8>

R4 v2 signature over attest::attestation_preimage(&header).

Implementations§

Source§

impl RedactedEnvelope

Source

pub fn content_hash(&self) -> &str

Content hash of the message this envelope redacts (f1220<hex64>).

Source

pub fn performative(&self) -> &str

Performative name of the redacted message.

Source

pub fn thread(&self) -> &str

Thread identifier — the envelope carries its thread, and store placement is by this authenticated field (REQ-702).

Source

pub fn verify(&self, signer: &dyn Signer) -> Result<(), AttestError>

REQ-701: verify the envelope from its own fields alone — the payload is never an input. Reconstructs the identical attestation preimage a full-message holder would, and dispatches on the key’s signature suite (typed rejection for unimplemented suites, REQ-708).

Source

pub fn verify_under_marker( &self, marker: SignatureDiscipline, signer: &dyn Signer, ) -> Result<(), AttestError>

Verify under an explicitly presented discipline marker (REQ-701).

The envelope form is the v2 discipline, so a signature declaring v1 is the typed AttestError::DisciplineMismatch — a v1 full-bytes signature never satisfies an envelope path, and no guess is attempted (fail closed, review finding 6).

Source

pub fn to_sexpr(&self) -> SExpr

Serialise to the CON-700 envelope production.

Canonical choices: keys in suite-explicit spelling, the recipient set in its canonical (suite, name) order, the thread as a string, the signature as lowercase hex — so serialise ∘ parse is identity and any holder re-derives identical bytes.

Trait Implementations§

Source§

impl Clone for RedactedEnvelope

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 RedactedEnvelope

Source§

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

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

impl Eq for RedactedEnvelope

Source§

impl PartialEq for RedactedEnvelope

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 RedactedEnvelope

Auto Trait Implementations§

§

impl Forget for RedactedEnvelope

§

impl Freeze for RedactedEnvelope
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, *const LeafNode<KeyId, SetValZST> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(KeyId, SetValZST)>>: Freeze, PhantomData<String>: Freeze,

§

impl Move for RedactedEnvelope

§

impl RefUnwindSafe for RedactedEnvelope

§

impl Send for RedactedEnvelope
where RawVecInner: Send, NodeRef<Owned, KeyId, SetValZST, LeafOrInternal>: Send, BoxRaw<(KeyId, SetValZST)>: Send,

§

impl Sync for RedactedEnvelope
where RawVecInner: Sync, NodeRef<Owned, KeyId, SetValZST, LeafOrInternal>: Sync, BoxRaw<(KeyId, SetValZST)>: Sync,

§

impl Unpin for RedactedEnvelope
where *const u8 is !null: Unpin, *const LeafNode<KeyId, SetValZST> is !null: Unpin, Box<(KeyId, SetValZST)>: Unpin,

§

impl UnsafeUnpin for RedactedEnvelope
where *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, *const LeafNode<KeyId, SetValZST> is !null: UnsafeUnpin, PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin, PhantomData<Box<(KeyId, SetValZST)>>: UnsafeUnpin, PhantomData<String>: UnsafeUnpin,

§

impl UnwindSafe for RedactedEnvelope
where RawVecInner: UnwindSafe, BTreeMap<KeyId, SetValZST>: UnwindSafe,

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.