Function libp2p_noise::handshake::rt15_responder
source · [−]pub fn rt15_responder<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 + Unpin + Send + 'static,
C: Protocol<C> + AsRef<[u8]>,
Expand description
Creates an authenticated Noise handshake for the responder of a 1.5-roundtrip (3 message) handshake pattern.
Subject to the chosen IdentityExchange
, this message sequence
identifies the local node in the second message payload and expects
the remote to identify itself in the third message payload. The first
(unencrypted) message payload is always empty.
This message sequence is suitable for authenticated 3-message Noise handshake
patterns where the static keys of the responder and initiator are either known
(i.e. appear in the pre-message pattern) or are sent with the second and third
message, respectively (e.g. XX
).
initiator --{}--> responder
initiator <-{id}- responder
initiator -{id}-> responder