org.glassfish.grizzly.websockets.draft06
Class SecKey
java.lang.Object
org.glassfish.grizzly.websockets.draft06.SecKey
public class SecKey
- extends java.lang.Object
Class represents WebSocket's security key, used during the handshake phase.
- Author:
- Alexey Stashok
|
Constructor Summary |
SecKey()
|
SecKey(java.lang.String base64)
|
|
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 |
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 |
KEY_SIZE
public static final int KEY_SIZE
- See Also:
- Constant Field Values
SecKey
public SecKey()
SecKey
public SecKey(java.lang.String base64)
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()
validateServerKey
public void validateServerKey(java.lang.String serverKey)
Copyright © 2011 Oracle Corpration. All Rights Reserved.