3.1.5.4.3 PUBLIC_KEY Message

The syntax of this message is specified in section 2.2.2.3. The message's public key, exponent, and modulus fields MUST be from the client's Public Key Pair (see section 3.1.1.1.3).

The RunspacePool MUST be in Opened state (section 3.1.1.2.2) when this message is sent. This message MUST be sent from a client to a server 1) in response to a public key request received from the server (see section 3.1.5.4.5), and 2) when the higher layer requests a Session Key exchange prior to sending secure strings from the client to the server (see section 3.1.4.8).

This message MUST be sent only once from a client to a server for one RunspacePool.

The Session Key Transfer timer (section 3.1.1.2.8) MUST be started by the PowerShell Remoting Protocol when it sends a PUBLIC_KEY message. There MUST be a unique timer for each PUBLIC_KEY message. Upon receipt of an ENCRYPTED_SESSION_KEY message (section 2.2.2.4) for that PUBLIC_KEY message, the timer MUST be canceled.

The Session Key Transfer timer MUST expire after the number of milliseconds given by the SessionKeyTransferTimeoutms (section 3.1.1.2.8). Upon expiration of this timer, the PowerShell Remoting Protocol MUST close the associated RunspacePool as described in section 3.1.4.1.