|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.enterprise.web.connector.grizzly.ssl.SSLUtils
public class SSLUtils
SSL over NIO utility class. The class handle the SSLEngine operations needed to support SSL over NIO. This class MUST be executed using an SSLWorkerThread as it rely on some SSLWorkerThread buffers and SSLEngine. TODO: Create an object that Wrap SSLEngine and its associated buffers.
| Field Summary | |
|---|---|
protected static ByteBuffer |
hsBB
|
static int |
MAX_BB_SIZE
The maximum size a ByteBuffer can take. |
| Constructor Summary | |
|---|---|
SSLUtils()
|
|
| Method Summary | |
|---|---|
static ByteBuffer |
doHandshake(SelectionKey key,
ByteBuffer byteBuffer,
ByteBuffer inputBB,
ByteBuffer outputBB,
SSLEngine sslEngine,
SSLEngineResult.HandshakeStatus handshakeStatus)
Perform an SSL handshake using the SSLEngine. |
static ByteBuffer |
doHandshake(SelectionKey key,
ByteBuffer byteBuffer,
ByteBuffer inputBB,
ByteBuffer outputBB,
SSLEngine sslEngine,
SSLEngineResult.HandshakeStatus handshakeStatus,
int timeout)
Perform an SSL handshake using the SSLEngine. |
static int |
doRead(SelectionKey key,
ByteBuffer inputBB,
SSLEngine sslEngine,
int timeout)
Read encrypted bytes using an SSLEngine. |
static SSLEngineResult.HandshakeStatus |
executeDelegatedTask(SSLEngine sslEngine)
Complete hanshakes operations. |
static int |
getReadTimeout()
|
static void |
setReadTimeout(int aReadTimeout)
|
static SSLEngineResult |
unwrap(ByteBuffer byteBuffer,
ByteBuffer inputBB,
SSLEngine sslEngine)
Unwrap available encrypted bytes from inputBB to
byteBuffer using the SSLEngine |
static ByteBuffer |
unwrapAll(ByteBuffer byteBuffer,
ByteBuffer inputBB,
SSLEngine sslEngine)
Unwrap all encrypted bytes from inputBB to
byteBuffer using the SSLEngine |
static SSLEngineResult |
wrap(ByteBuffer byteBuffer,
ByteBuffer outputBB,
SSLEngine sslEngine)
Encrypt bytes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MAX_BB_SIZE
protected static final ByteBuffer hsBB
| Constructor Detail |
|---|
public SSLUtils()
| Method Detail |
|---|
public static int doRead(SelectionKey key,
ByteBuffer inputBB,
SSLEngine sslEngine,
int timeout)
SSLEngine.
key - The SelectionKeyinputBB - The byteBuffer to store encrypted bytessslEngine - The SSLEngine uses to manage the SSL operations.timeout - The Selector.select() timeout value. A value of 0 will
be exectuted as a Selector.selectNow();
public static ByteBuffer unwrapAll(ByteBuffer byteBuffer,
ByteBuffer inputBB,
SSLEngine sslEngine)
throws IOException
inputBB to
byteBuffer using the SSLEngine
byteBuffer - the decrypted ByteBufferinputBB - the encrypted ByteBuffersslEngine - The SSLEngine used to manage the SSL operations.
IOException
public static SSLEngineResult unwrap(ByteBuffer byteBuffer,
ByteBuffer inputBB,
SSLEngine sslEngine)
throws IOException
inputBB to
byteBuffer using the SSLEngine
byteBuffer - the decrypted ByteBufferinputBB - the encrypted ByteBuffersslEngine - The SSLEngine used to manage the SSL operations.
IOException
public static SSLEngineResult wrap(ByteBuffer byteBuffer,
ByteBuffer outputBB,
SSLEngine sslEngine)
throws IOException
byteBuffer - the decrypted ByteBufferoutputBB - the encrypted ByteBuffersslEngine - The SSLEngine used to manage the SSL operations.
IOExceptionpublic static SSLEngineResult.HandshakeStatus executeDelegatedTask(SSLEngine sslEngine)
sslEngine - The SSLEngine used to manage the SSL operations.
public static ByteBuffer doHandshake(SelectionKey key,
ByteBuffer byteBuffer,
ByteBuffer inputBB,
ByteBuffer outputBB,
SSLEngine sslEngine,
SSLEngineResult.HandshakeStatus handshakeStatus)
throws IOException
key - the SelectionKeybyteBuffer - The application ByteBufferinputBB - The encrypted input ByteBufferoutputBB - The encrypted output ByteBuffersslEngine - The SSLEngine used.handshakeStatus - The current handshake statustimeout - The time the Selector will block waiting for bytes
IOException
public static ByteBuffer doHandshake(SelectionKey key,
ByteBuffer byteBuffer,
ByteBuffer inputBB,
ByteBuffer outputBB,
SSLEngine sslEngine,
SSLEngineResult.HandshakeStatus handshakeStatus,
int timeout)
throws IOException
key - the SelectionKeybyteBuffer - The application ByteBufferinputBB - The encrypted input ByteBufferoutputBB - The encrypted output ByteBuffersslEngine - The SSLEngine used.handshakeStatus - The current handshake status
IOExceptionpublic static int getReadTimeout()
public static void setReadTimeout(int aReadTimeout)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||