Function libp2p_noise::handshake::rt1_initiator
source · [−]pub fn rt1_initiator<T, C>(
io: T,
session: Result<HandshakeState, NoiseError>,
identity: KeypairIdentity,
identity_x: IdentityExchange,
legacy: LegacyConfig
) -> Handshake<T, C>ⓘNotable traits for Handshake<T, C>impl<T, C> Future for Handshake<T, C> type Output = Result<(RemoteIdentity<C>, NoiseOutput<T>), NoiseError>;
where
T: AsyncWrite + AsyncRead + Send + Unpin + 'static,
C: Protocol<C> + AsRef<[u8]>,
Expand description
Creates an authenticated Noise handshake for the initiator of a single roundtrip (2 message) handshake pattern.
Subject to the chosen IdentityExchange
, this message sequence
identifies the local node to the remote with the first message payload
(i.e. unencrypted) and expects the remote to identify itself in the
second message payload.
This message sequence is suitable for authenticated 2-message Noise handshake
patterns where the static keys of the initiator and responder are either
known (i.e. appear in the pre-message pattern) or are sent with
the first and second message, respectively (e.g. IK
or IX
).
initiator -{id}-> responder
initiator <-{id}- responder