|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.grizzly.websockets.SecKey
public class SecKey
Class represents WebSocket's security key, used during the handshake phase.
See Sec-WebSocket-Key1, Sec-WebSocket-Key2.
| Method Summary | |
|---|---|
static SecKey |
create(String secKey)
Create a SecKey object basing on String representation, which
includes spaces and chars. |
static SecKey |
generateSecKey()
Generates random security key. |
static byte[] |
generateServerKey(SecKey clientKey1,
SecKey clientKey2,
byte[] clientKey3)
Generate server-side security key, which gets passed to the client during the handshake phase as part of message payload. |
String |
getSecKey()
Gets security key string representation, which includes chars and spaces. |
long |
getSecKeyValue()
Gets original security key value (already divided by number of spaces). |
String |
toString()
|
static SecKey |
validateSecKey(String key)
Validate security key, represented as string value (which includes chars and spaces). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static SecKey create(String secKey)
String representation, which
includes spaces and chars. Method also performs key validation.
secKey - security key string representation with spaces and chars included.
public String getSecKey()
public long getSecKeyValue()
public String toString()
toString in class Objectpublic static SecKey generateSecKey()
public static byte[] generateServerKey(SecKey clientKey1,
SecKey clientKey2,
byte[] clientKey3)
throws NoSuchAlgorithmException
clientKey1 - client's Sec-WebSocket-Key1clientKey2 - client's Sec-WebSocket-Key2clientKey3 - client's key3, which is sent as part of handshake request payload.
NoSuchAlgorithmExceptionpublic static SecKey validateSecKey(String key)
key - security key, represented as string value (which includes chars and spaces).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||