The client's side of the opening exchange (spec, "Communication" and "Encryption") when this app is the client, here a controller that connects out to a server: send client/init, read server/init, read Noise message 1 (the server is always the initiator, whichever side opened the WebSocket), pick the PSK it names (or fall back to the Sentinel), answer with message 2 and switch to transport mode.
More...
|
| class | Held |
| | A PSK the client holds and the server it belongs to (null for a pairing PSK, which is not bound to a server).
|
| |
| interface | PskLookup |
| | What the client holds for the PSK that message 1 names: the id (43 characters) and the category. More...
|
| |
| class | Result |
| | What the handshake yields.
|
| |
|
| static Result | perform (WsConnection ws, Identity identity, NoiseSuite suite, PskLookup psks, SecureRandom random) throws IOException |
| |
| static SendspinPsk.Category | rehandshake (SecureChannel channel, Identity identity, String serverId, NoiseSuite suite, PskLookup psks, byte[] message1, SecureRandom random) throws IOException |
| | The responder side of a re-handshake inside the open channel (the server starts one after a pairing, to move to the long-term PSK): reads Noise message 1 (already received, decoded), looks up the PSK it names (no Sentinel fallback here: a PSK this client does not hold ends the connection), answers with message 2 under the old keys and puts the new keys in place.
|
| |
The client's side of the opening exchange (spec, "Communication" and "Encryption") when this app is the client, here a controller that connects out to a server: send client/init, read server/init, read Noise message 1 (the server is always the initiator, whichever side opened the WebSocket), pick the PSK it names (or fall back to the Sentinel), answer with message 2 and switch to transport mode.
Every failure ends in a ServerHandshake.HandshakeException; the caller closes without another message (a server/error is the one case the server answers).
◆ perform()
- Parameters
-
| ws | a connection whose WebSocket handshake is done; its read timeout bounds each step |
| suite | the cipher suite this client asks for |
◆ rehandshake()
| static SendspinPsk.Category de.yaacc.sendspin.session.ClientHandshake.rehandshake |
( |
SecureChannel | channel, |
|
|
Identity | identity, |
|
|
String | serverId, |
|
|
NoiseSuite | suite, |
|
|
PskLookup | psks, |
|
|
byte[] | message1, |
|
|
SecureRandom | random ) throws IOException |
|
static |
The responder side of a re-handshake inside the open channel (the server starts one after a pairing, to move to the long-term PSK): reads Noise message 1 (already received, decoded), looks up the PSK it names (no Sentinel fallback here: a PSK this client does not hold ends the connection), answers with message 2 under the old keys and puts the new keys in place.
The prologue is the previous handshake hash. The send lock is held until the new keys are in, so no application message goes out between.
- Returns
- the category of the PSK the new keys are under
The documentation for this class was generated from the following file:
- /github/workspace/yaacc/src/main/java/de/yaacc/sendspin/session/ClientHandshake.java