public class SSLSession extends Object implements Closeable
| 限定符和类型 | 字段和说明 |
|---|---|
protected boolean |
closed |
protected static ByteBuffer |
hsBuffer |
protected boolean |
initialHSComplete |
protected SSLEngineResult.HandshakeStatus |
initialHSStatus |
protected ByteBuffer |
inNetBuffer |
protected static Log |
log |
protected ByteBuffer |
requestBuffer |
protected static int |
requestBufferSize |
protected Session |
session |
protected SSLEngine |
sslEngine |
protected SSLEventHandler |
sslEventHandler |
protected static int |
writeBufferSize |
| 构造器和说明 |
|---|
SSLSession(SSLContext sslContext,
Session session,
boolean useClientMode,
SSLEventHandler sslEventHandler) |
SSLSession(SSLContext sslContext,
SSLEngine sslEngine,
Session session,
boolean useClientMode,
SSLEventHandler sslEventHandler,
org.eclipse.jetty.alpn.ALPN.Provider provider) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
protected boolean |
doHandshake(ByteBuffer receiveBuffer)
The initial handshake is a procedure by which the two peers exchange
communication parameters until an SSLSession is established.
|
protected void |
doHandshakeResponse() |
protected SSLEngineResult.HandshakeStatus |
doTasks()
Do all the outstanding handshake tasks in the current Thread.
|
protected ByteBuffer |
getRequestBuffer() |
boolean |
isHandshakeFinished() |
boolean |
isOpen() |
protected void |
merge(ByteBuffer now) |
ByteBuffer |
read(ByteBuffer receiveBuffer)
This method is used to decrypt data, it implied do handshake
|
long |
transferFileRegion(FileRegion file,
Callback callback) |
int |
write(ByteBuffer[] outputBuffers,
Callback callback) |
int |
write(ByteBuffer outputBuffer,
Callback callback)
This method is used to encrypt and flush to socket channel
|
protected static final Log log
protected final Session session
protected final SSLEngine sslEngine
protected ByteBuffer inNetBuffer
protected ByteBuffer requestBuffer
protected static final int requestBufferSize
protected static final int writeBufferSize
protected static final ByteBuffer hsBuffer
protected boolean closed
protected SSLEngineResult.HandshakeStatus initialHSStatus
protected boolean initialHSComplete
protected final SSLEventHandler sslEventHandler
public SSLSession(SSLContext sslContext, Session session, boolean useClientMode, SSLEventHandler sslEventHandler) throws Throwable
Throwablepublic SSLSession(SSLContext sslContext, SSLEngine sslEngine, Session session, boolean useClientMode, SSLEventHandler sslEventHandler, org.eclipse.jetty.alpn.ALPN.Provider provider) throws Throwable
Throwableprotected boolean doHandshake(ByteBuffer receiveBuffer) throws Throwable
receiveBuffer - Encrypted messageThrowable - A runtime exceptionprotected void merge(ByteBuffer now)
protected ByteBuffer getRequestBuffer()
protected SSLEngineResult.HandshakeStatus doTasks()
public void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionpublic boolean isOpen()
public ByteBuffer read(ByteBuffer receiveBuffer) throws Throwable
receiveBuffer - Encrypted messageThrowable - sslEngine error during data readpublic int write(ByteBuffer[] outputBuffers, Callback callback) throws Throwable
Throwablepublic int write(ByteBuffer outputBuffer, Callback callback) throws Throwable
outputBuffer - Plaintext messageThrowable - sslEngine error during data writepublic long transferFileRegion(FileRegion file, Callback callback) throws Throwable
Throwablepublic boolean isHandshakeFinished()
Copyright © 2016. All rights reserved.