pub struct RekeyFrame {
pub header: DataFrameHeader,
pub ephemeral_public: [u8; 32],
pub timestamp: u32,
}Available on crate feature
transport only.Expand description
A rekey frame for forward secrecy through key rotation.
Wire format (encrypted portion):
+---------------------------+------------------+
| New Ephemeral Public Key | Timestamp |
| 32 bytes | 4 bytes (LE32) |
+---------------------------+------------------+The frame header (16 bytes) is used as AAD for AEAD encryption.
Fields§
§header: DataFrameHeaderThe frame header (type = Rekey).
ephemeral_public: [u8; 32]New ephemeral public key for the DH exchange.
timestamp: u32Current timestamp in milliseconds since session start.
Implementations§
Source§impl RekeyFrame
impl RekeyFrame
Sourcepub fn new(
session_id: SessionId,
nonce_counter: u64,
ephemeral_public: [u8; 32],
timestamp: u32,
) -> Self
pub fn new( session_id: SessionId, nonce_counter: u64, ephemeral_public: [u8; 32], timestamp: u32, ) -> Self
Create a new rekey frame.
Sourcepub fn from_decrypted(
header: DataFrameHeader,
payload: &[u8],
) -> Result<Self, FrameError>
pub fn from_decrypted( header: DataFrameHeader, payload: &[u8], ) -> Result<Self, FrameError>
Parse a rekey frame from decrypted payload.
Trait Implementations§
Source§impl Clone for RekeyFrame
impl Clone for RekeyFrame
Source§fn clone(&self) -> RekeyFrame
fn clone(&self) -> RekeyFrame
Returns a duplicate of the value. Read more
1.0.0 · 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 RekeyFrame
impl Debug for RekeyFrame
impl Copy for RekeyFrame
Auto Trait Implementations§
impl Freeze for RekeyFrame
impl RefUnwindSafe for RekeyFrame
impl Send for RekeyFrame
impl Sync for RekeyFrame
impl Unpin for RekeyFrame
impl UnwindSafe for RekeyFrame
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