pub struct Envelope;Expand description
High-level envelope encryption operations (seal, open, open_with_keyring, inspect).
Implementations§
Source§impl Envelope
impl Envelope
Sourcepub fn inspect(envelope: &[u8]) -> Result<EnvelopeHeader>
pub fn inspect(envelope: &[u8]) -> Result<EnvelopeHeader>
Inspects the envelope header metadata without decrypting.
Sourcepub fn seal(
policy: SecurityPolicy,
recipient: &AgilePublicKey,
aead: AeadAlgorithm,
plaintext: &[u8],
associated_data: &[u8],
) -> Result<Vec<u8>>
pub fn seal( policy: SecurityPolicy, recipient: &AgilePublicKey, aead: AeadAlgorithm, plaintext: &[u8], associated_data: &[u8], ) -> Result<Vec<u8>>
Encrypts plaintext for recipient under policy, binding optional associated_data.
Sourcepub fn open(
policy: SecurityPolicy,
recipient_secret: &AgileSecretKey,
envelope: &[u8],
aad: &[u8],
) -> Result<Vec<u8>>
pub fn open( policy: SecurityPolicy, recipient_secret: &AgileSecretKey, envelope: &[u8], aad: &[u8], ) -> Result<Vec<u8>>
Decrypts an envelope with recipient_secret, enforcing policy and verifying aad.
Sourcepub fn open_with_keyring(
policy: SecurityPolicy,
keyring: &[&AgileSecretKey],
envelope: &[u8],
aad: &[u8],
) -> Result<Vec<u8>>
pub fn open_with_keyring( policy: SecurityPolicy, keyring: &[&AgileSecretKey], envelope: &[u8], aad: &[u8], ) -> Result<Vec<u8>>
Attempts decryption across a keyring of active/previous keys for zero-downtime key rotation
and algorithm migration (e.g., transitioning from ML-KEM-768 to X-Wing or ML-KEM-1024).
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