pub struct EncryptedEnvelope {
pub id: String,
pub sender_did: Did,
pub recipient_did: Did,
pub ephemeral_public_key: [u8; 32],
pub kdf_version: Option<u16>,
pub ciphertext: Vec<u8>,
pub content_type: ContentType,
pub signature: Signature,
pub release_on_death: bool,
pub release_delay_hours: u32,
pub created: Timestamp,
}Expand description
An encrypted message envelope — the complete wire format.
The ciphertext is produced by X25519 ECDH + HKDF + XChaCha20-Poly1305.
Format: [24-byte nonce][ciphertext][16-byte Poly1305 tag]
(same layout as VaultEncryptor in exo-identity).
Fields§
§id: StringUnique message ID.
sender_did: DidSender’s DID.
recipient_did: DidRecipient’s DID.
ephemeral_public_key: [u8; 32]Ephemeral X25519 public key used for this message’s ECDH.
kdf_version: Option<u16>KDF version used to derive the symmetric key.
None means the envelope was created before KDF versioning existed.
New envelopes must set KDF_VERSION_TRANSCRIPT_SALTED.
ciphertext: Vec<u8>Encrypted payload: [nonce][ciphertext][tag].
content_type: ContentTypeContent type classification.
signature: SignatureEd25519 signature over the canonical envelope bytes (excl. signature field).
release_on_death: boolWhether this message should be released after the sender’s death.
release_delay_hours: u32Delay in hours after death verification before release (0 = immediate).
created: TimestampCreation timestamp (hybrid logical clock).
Implementations§
Source§impl EncryptedEnvelope
impl EncryptedEnvelope
Sourcepub fn signing_payload(&self) -> Result<Vec<u8>, MessagingError>
pub fn signing_payload(&self) -> Result<Vec<u8>, MessagingError>
Compute the domain-separated canonical CBOR payload for signing.
The payload covers every envelope field except the signature itself.
§Errors
Returns MessagingError::EnvelopeSigningPayloadEncoding if the CBOR
encoder rejects the payload.
Trait Implementations§
Source§impl Clone for EncryptedEnvelope
impl Clone for EncryptedEnvelope
Source§fn clone(&self) -> EncryptedEnvelope
fn clone(&self) -> EncryptedEnvelope
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more