org.glassfish.grizzly.websockets
Class SecKey

java.lang.Object
  extended by org.glassfish.grizzly.websockets.SecKey

public class SecKey
extends java.lang.Object

Class represents WebSocket's security key, used during the handshake phase.

Author:
Alexey Stashok

Field Summary
static int KEY_SIZE
           
 
Constructor Summary
SecKey()
           
 
Method Summary
static SecKey generateServerKey(SecKey clientKey)
          Generate server-side security key, which gets passed to the client during the handshake phase as part of message payload.
 byte[] getBytes()
           
 java.lang.String getNonce()
           
 java.lang.String getSecKey()
          Gets security key string representation, which includes chars and spaces.
 java.lang.String toString()
           
 void validateServerKey(java.lang.String serverKey)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY_SIZE

public static final int KEY_SIZE
See Also:
Constant Field Values
Constructor Detail

SecKey

public SecKey()
Method Detail

generateServerKey

public static SecKey generateServerKey(SecKey clientKey)
                                throws HandshakeException
Generate server-side security key, which gets passed to the client during the handshake phase as part of message payload.

Parameters:
clientKey - client's Sec-WebSocket-Key
Returns:
server key.
Throws:
HandshakeException

getSecKey

public java.lang.String getSecKey()
Gets security key string representation, which includes chars and spaces.

Returns:
Security key string representation, which includes chars and spaces.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getBytes

public byte[] getBytes()

getNonce

public java.lang.String getNonce()

validateServerKey

public void validateServerKey(java.lang.String serverKey)


Copyright © 2011 Oracle Corpration. All Rights Reserved.