public class TLSConnectionHandler
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.nio.ByteBuffer |
myAppData
The ByteBuffer holds this peer's application data in plaintext.
|
protected java.nio.ByteBuffer |
myNetData
The ByteBuffer holds this peer's TLS encrypted data.
|
protected java.nio.ByteBuffer |
peerAppData
The ByteBuffer holds the other peer's application data in plaintext.
|
protected java.nio.ByteBuffer |
peerNetData
The ByteBuffer holds other peer's TLS encrypted data.
|
| Constructor and Description |
|---|
TLSConnectionHandler(java.nio.channels.SocketChannel socketChannel,
javax.net.ssl.SSLEngine sslEngine) |
| Modifier and Type | Method and Description |
|---|---|
java.nio.ByteBuffer |
decryptNextTLSDataRecord(java.nio.ByteBuffer rbuf)
Decrypt the next TLS data record to plain text data.
|
boolean |
doTlsHandshake(long timeoutInMillis)
Initial handshake (for establishing cipher suite and key exchange between client and server).
|
int |
encryptNextTLSDataRecord(java.nio.ByteBuffer obuf,
java.nio.ByteBuffer wbuf)
Convert plain text data record to encrypted data.
|
protected java.nio.ByteBuffer myAppData
protected java.nio.ByteBuffer myNetData
protected java.nio.ByteBuffer peerAppData
protected java.nio.ByteBuffer peerNetData
public TLSConnectionHandler(java.nio.channels.SocketChannel socketChannel,
javax.net.ssl.SSLEngine sslEngine)
public boolean doTlsHandshake(long timeoutInMillis)
throws java.io.IOException
timeoutInMillis - the amount of time to wait for TLS handshake finish before timeout.java.io.IOException - if there is an error occurred during read/write to the socket channel.javax.net.ssl.SSLException - if a problem was encountered while signaling the SSLEngine to begin a new handshake
or if a problem was encountered while processing the data that caused the SSLEngine to abort.java.lang.IllegalStateException - if the client/server mode has not yet been set.java.lang.IllegalArgumentException - if the handshake status is invalid.OperationTimeoutException - if global operation timeout is exceededpublic int encryptNextTLSDataRecord(java.nio.ByteBuffer obuf,
java.nio.ByteBuffer wbuf)
throws java.io.IOException
java.io.IOExceptionpublic java.nio.ByteBuffer decryptNextTLSDataRecord(java.nio.ByteBuffer rbuf)
throws java.io.IOException
rbuf - the buffer that contains TLS data record which will be decrypted.java.io.IOExceptionCopyright © 2006-2009 Dustin Sallings, 2009-2013 Couchbase, Inc.