pub struct KeySpace {
pub cipher: Cipher,
pub secret: Vec<u8>,
pub record_count: u64,
pub key_epoch: Option<usize>,
}Expand description
KeySpace represents the decryption context of some keys.
E.g. Handshake Space or Traffic Space.
Fields§
§cipher: Cipher§secret: Vec<u8>§record_count: u64§key_epoch: Option<usize>Defined for application traffic
Implementations§
Source§impl KeySpace
impl KeySpace
Sourcepub fn handshake_traffic_secret(secret: Vec<u8>, cipher: Cipher) -> Self
pub fn handshake_traffic_secret(secret: Vec<u8>, cipher: Cipher) -> Self
Construct a new key space from a handshake secret
Sourcepub fn first_traffic_secret(secret: Vec<u8>, cipher: Cipher) -> Self
pub fn first_traffic_secret(secret: Vec<u8>, cipher: Cipher) -> Self
Construct a new key space from the first traffic secret
Sourcepub fn key_update(&self) -> Self
pub fn key_update(&self) -> Self
Construct a new key space following a key update
Defined in https://www.rfc-editor.org/rfc/rfc8446#section-7.2
Sourcepub fn traffic_key(&self) -> Result<(Vec<u8>, Vec<u8>)>
pub fn traffic_key(&self) -> Result<(Vec<u8>, Vec<u8>)>
Return the actual key and IV which will be used the the symmetric cipher
Sourcepub fn decrypt_record(
&mut self,
header: &RecordHeader,
record: &[u8],
) -> Vec<u8> ⓘ
pub fn decrypt_record( &mut self, header: &RecordHeader, record: &[u8], ) -> Vec<u8> ⓘ
record: the encrypted record, exclusive of the headersender: the party who transmitted the record
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeySpace
impl RefUnwindSafe for KeySpace
impl Send for KeySpace
impl Sync for KeySpace
impl Unpin for KeySpace
impl UnwindSafe for KeySpace
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more