Function network_clique::protocols::handshake::execute_v0_handshake_outgoing
source · pub async fn execute_v0_handshake_outgoing<SK: SecretKey, S: Splittable>(
stream: S,
secret_key: SK,
public_key: SK::PublicKey
) -> Result<(S::Sender, S::Receiver), HandshakeError<SK::PublicKey>>
Expand description
Performs the handshake with a peer that we called. We assume that their public key is known to us. The goal is to authenticate ourselves, and split the communication stream into two halves. We need to prove our identity by signing a randomly generated challenge, but apart from that, the returned communication channels will NOT be secured in any way. We assume that if the channel is compromised after the handshake, we will establish another connection, which will replace the current one.