pub struct KeyMaterial<'a> {
pub kk: KmKeyFlag,
pub keki: u32,
pub cipher: Cipher,
pub auth: KmAuth,
pub se: StreamEncapsulation,
pub salt: &'a [u8],
pub icv: [u8; 8],
pub x_sek: &'a [u8],
pub o_sek: Option<&'a [u8]>,
}Expand description
Key Material message (draft-sharabayko-srt-01 §3.2.2, Figures 10-11).
Fields§
§kk: KmKeyFlagWhich SEK(s) Self::x_sek / Self::o_sek carry.
keki: u32Key Encryption Key Index (big-endian; 0 = default stream key).
cipher: CipherEncryption cipher and mode.
auth: KmAuthMessage authentication code algorithm.
se: StreamEncapsulationStream encapsulation.
salt: &'a [u8]Salt / IV (SLen bytes; 0 if absent, else 16 bytes / 128 bits per
the only length the spec defines).
icv: [u8; 8]64-bit AES key-wrap Integrity Check Vector.
x_sek: &'a [u8]The (even or odd, per Self::kk) SEK, wrapped. KLen bytes
(16/24/32, matching the handshake’s Encryption Field).
o_sek: Option<&'a [u8]>The odd SEK, wrapped, present only when Self::kk is
KmKeyFlag::Both (same length as Self::x_sek).
Implementations§
Source§impl<'a> KeyMaterial<'a>
impl<'a> KeyMaterial<'a>
Sourcepub fn parse(bytes: &'a [u8]) -> Result<Self>
pub fn parse(bytes: &'a [u8]) -> Result<Self>
Parse a Key Material message from bytes (exactly the message —
either a handshake extension’s contents or a User-Defined control
packet’s CIF).
Sourcepub fn serialized_len(&self) -> usize
pub fn serialized_len(&self) -> usize
Number of bytes Self::serialize_into will write.
Sourcepub fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
pub fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
Serialize this Key Material message into buf.
Trait Implementations§
Source§impl<'a> Clone for KeyMaterial<'a>
impl<'a> Clone for KeyMaterial<'a>
Source§fn clone(&self) -> KeyMaterial<'a>
fn clone(&self) -> KeyMaterial<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for KeyMaterial<'a>
impl<'a> Debug for KeyMaterial<'a>
impl<'a> Eq for KeyMaterial<'a>
Source§impl<'a> Hash for KeyMaterial<'a>
impl<'a> Hash for KeyMaterial<'a>
Source§impl<'a> PartialEq for KeyMaterial<'a>
impl<'a> PartialEq for KeyMaterial<'a>
Source§impl<'a> Serialize for KeyMaterial<'a>
Available on crate feature serde only.
impl<'a> Serialize for KeyMaterial<'a>
serde only.