pub async fn server_handshake<R, W>(
reader: &mut R,
writer: &mut W,
server_keypair: &Keypair,
local_creds: &PeerCredentials,
remote_creds: &PeerCredentials,
) -> Result<NoiseTransport>Expand description
Perform the server-side (responder) Noise IK handshake.
Called after stream.into_split() and extract_ucred(), before the
read/write loops. The server’s static keypair was generated at startup
and the client’s identity is verified via the Noise handshake + UCred
prologue binding.
IK handshake (responder perspective):
- Read message 1 from initiator (contains initiator’s ephemeral + encrypted static)
- Write message 2 to initiator (contains responder’s ephemeral)
- Handshake complete — derive transport keys
§Errors
Returns an error if the handshake fails or times out.