pub struct PacketSecurityEnvelope {
pub key_id: u32,
pub nonce: u64,
pub payload: Vec<u8>,
pub tag: Vec<u8>,
}Expand description
Owned packet security envelope.
Fields§
§key_id: u32External key identifier chosen by the embedder.
nonce: u64Nonce scoped to key_id.
payload: Vec<u8>Ciphertext or plaintext payload, depending on the configured cipher.
tag: Vec<u8>Authentication tag produced by the configured authenticator.
Implementations§
Source§impl PacketSecurityEnvelope
impl PacketSecurityEnvelope
Sourcepub fn encode_parts(
config: PacketSecurityConfig,
key_id: u32,
nonce: u64,
payload: &[u8],
tag: &[u8],
out: &mut Vec<u8>,
) -> Result<(), PacketSecurityEncodeError>
pub fn encode_parts( config: PacketSecurityConfig, key_id: u32, nonce: u64, payload: &[u8], tag: &[u8], out: &mut Vec<u8>, ) -> Result<(), PacketSecurityEncodeError>
Appends an envelope from borrowed payload and tag slices.
Sourcepub fn encode(
&self,
config: PacketSecurityConfig,
out: &mut Vec<u8>,
) -> Result<(), PacketSecurityEncodeError>
pub fn encode( &self, config: PacketSecurityConfig, out: &mut Vec<u8>, ) -> Result<(), PacketSecurityEncodeError>
Encodes a packet security envelope.
Sourcepub fn decode(
config: PacketSecurityConfig,
input: &[u8],
) -> Result<Self, PacketSecurityDecodeError>
pub fn decode( config: PacketSecurityConfig, input: &[u8], ) -> Result<Self, PacketSecurityDecodeError>
Decodes a packet security envelope.
Trait Implementations§
Source§impl Clone for PacketSecurityEnvelope
impl Clone for PacketSecurityEnvelope
Source§fn clone(&self) -> PacketSecurityEnvelope
fn clone(&self) -> PacketSecurityEnvelope
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PacketSecurityEnvelope
impl Debug for PacketSecurityEnvelope
impl Eq for PacketSecurityEnvelope
Source§impl PartialEq for PacketSecurityEnvelope
impl PartialEq for PacketSecurityEnvelope
impl StructuralPartialEq for PacketSecurityEnvelope
Auto Trait Implementations§
impl Freeze for PacketSecurityEnvelope
impl RefUnwindSafe for PacketSecurityEnvelope
impl Send for PacketSecurityEnvelope
impl Sync for PacketSecurityEnvelope
impl Unpin for PacketSecurityEnvelope
impl UnsafeUnpin for PacketSecurityEnvelope
impl UnwindSafe for PacketSecurityEnvelope
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