com.sun.grizzly.websockets
Class SecKey

java.lang.Object
  extended by com.sun.grizzly.websockets.SecKey

public class SecKey
extends 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()
           
 String getSecKey()
          Gets security key string representation, which includes chars and spaces.
 String toString()
           
 void validateServerKey(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 String getSecKey()
Gets security key string representation, which includes chars and spaces.

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

toString

public String toString()
Overrides:
toString in class Object

getBytes

public byte[] getBytes()

validateServerKey

public void validateServerKey(String serverKey)


Copyright © 2012 Oracle Corporation. All Rights Reserved.