pub struct SessionMsg3 {
pub flags: u8,
pub handshake_payload: Vec<u8>,
}Expand description
XK handshake message 3 (initiator -> responder).
Carries the initiator’s encrypted static key and epoch. Sent by the initiator after receiving msg2. The responder learns the initiator’s identity from this message.
§Wire Format
| Offset | Field | Size | Description |
|---|---|---|---|
| 0 | flags | 1 byte | Reserved |
| 1 | handshake_len | 2 bytes | u16 LE, Noise payload length |
| 3 | handshake_payload | variable | Noise XK msg3 (73 bytes typical) |
Fields§
§flags: u8Reserved flags byte.
handshake_payload: Vec<u8>Noise XK handshake message 3.
Implementations§
Source§impl SessionMsg3
impl SessionMsg3
Sourcepub fn new(handshake_payload: Vec<u8>) -> Self
pub fn new(handshake_payload: Vec<u8>) -> Self
Create a new SessionMsg3 with the given handshake payload.
Sourcepub fn encode(&self) -> Vec<u8> ⓘ
pub fn encode(&self) -> Vec<u8> ⓘ
Encode as wire format (4-byte FSP prefix + flags + handshake).
The 4-byte prefix: [ver_phase:1][flags:1][payload_len:2 LE]
where ver_phase = 0x03 (version 0, phase MSG3).
Sourcepub fn decode(payload: &[u8]) -> Result<Self, ProtocolError>
pub fn decode(payload: &[u8]) -> Result<Self, ProtocolError>
Decode from wire format (after 4-byte FSP prefix has been consumed).
Trait Implementations§
Source§impl Clone for SessionMsg3
impl Clone for SessionMsg3
Source§fn clone(&self) -> SessionMsg3
fn clone(&self) -> SessionMsg3
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 moreAuto Trait Implementations§
impl Freeze for SessionMsg3
impl RefUnwindSafe for SessionMsg3
impl Send for SessionMsg3
impl Sync for SessionMsg3
impl Unpin for SessionMsg3
impl UnsafeUnpin for SessionMsg3
impl UnwindSafe for SessionMsg3
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more