pub struct Envelope { /* private fields */ }Expand description
An encrypted message: hybrid KEM ciphertext plus AEAD-protected payload.
Wire layout (QSE2):
magic[4] | version u8 | suite u8 | epk_x25519[32] | ct_mlkem[1568] | nonce[12] | aead_ct[..]Everything before aead_ct is authenticated as AEAD associated data, so
no header field can be modified without failing decryption.
Implementations§
Source§impl Envelope
impl Envelope
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
Parse a v2 envelope.
§Errors
Returns Error::InvalidEnvelope on malformed input,
Error::LegacyV1Artifact for 0.1.x JSON artifacts, and
version/suite errors for unknown formats.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Envelope
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Envelope
Available on crate feature
serde only.Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Envelope
impl StructuralPartialEq for Envelope
Auto Trait Implementations§
impl Freeze for Envelope
impl RefUnwindSafe for Envelope
impl Send for Envelope
impl Sync for Envelope
impl Unpin for Envelope
impl UnsafeUnpin for Envelope
impl UnwindSafe for Envelope
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more