[][src]Function libp2p_noise::handshake::rt1_initiator

Important traits for Handshake<T, C>
pub fn rt1_initiator<T, C>(
    io: T,
    session: Result<HandshakeState, NoiseError>,
    identity: KeypairIdentity,
    identity_x: IdentityExchange
) -> Handshake<T, C> where
    T: AsyncWrite + AsyncRead + Send + Unpin + 'static,
    C: Protocol<C> + AsRef<[u8]>, 

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