class DefaultSslEngineFacade extends java.lang.Object implements ProtonSslEngine
| Modifier and Type | Field and Description |
|---|---|
private javax.net.ssl.SSLEngine |
_sslEngine |
private static int |
APPLICATION_BUFFER_EXTRA
Our testing has shown that application buffers need to be a bit larger
than that provided by
SSLSession.getApplicationBufferSize() otherwise
SSLEngineResult.Status.BUFFER_OVERFLOW will result on SSLEngine#unwrap(). |
| Constructor and Description |
|---|
DefaultSslEngineFacade(javax.net.ssl.SSLEngine sslEngine) |
| Modifier and Type | Method and Description |
|---|---|
private int |
getApplicationBufferSize() |
java.lang.String |
getCipherSuite() |
java.lang.Runnable |
getDelegatedTask() |
int |
getEffectiveApplicationBufferSize()
Gets the application buffer size.
|
javax.net.ssl.SSLEngineResult.HandshakeStatus |
getHandshakeStatus() |
int |
getPacketBufferSize() |
java.lang.String |
getProtocol() |
boolean |
getUseClientMode() |
java.lang.String |
toString() |
javax.net.ssl.SSLEngineResult |
unwrap(java.nio.ByteBuffer src,
java.nio.ByteBuffer dst) |
javax.net.ssl.SSLEngineResult |
wrap(java.nio.ByteBuffer src,
java.nio.ByteBuffer dst) |
private final javax.net.ssl.SSLEngine _sslEngine
private static final int APPLICATION_BUFFER_EXTRA
SSLSession.getApplicationBufferSize() otherwise
SSLEngineResult.Status.BUFFER_OVERFLOW will result on SSLEngine#unwrap().
Sun's own example uses 50, so we use the same.public javax.net.ssl.SSLEngineResult wrap(java.nio.ByteBuffer src,
java.nio.ByteBuffer dst)
throws javax.net.ssl.SSLException
wrap in interface ProtonSslEnginejavax.net.ssl.SSLExceptionNote that wrap really does write one packet worth of data to the
dst byte buffer. If dst byte buffer is insufficiently large the
pointers within both src and dst are unchanged and the bytesConsumed and
bytesProduced on the returned result are zero.public javax.net.ssl.SSLEngineResult unwrap(java.nio.ByteBuffer src,
java.nio.ByteBuffer dst)
throws javax.net.ssl.SSLException
unwrap in interface ProtonSslEnginejavax.net.ssl.SSLExceptionNote that unwrap does read exactly one packet of encoded data from src
and write to dst. If src contains insufficient bytes to read a complete
packet {@link Status#BUFFER_UNDERFLOW} occurs. If underflow occurs the
pointers within both src and dst are unchanged and the bytesConsumed and
bytesProduced on the returned result are zero.public int getEffectiveApplicationBufferSize()
ProtonSslEnginegetEffectiveApplicationBufferSize in interface ProtonSslEngineAPPLICATION_BUFFER_EXTRAprivate int getApplicationBufferSize()
public int getPacketBufferSize()
getPacketBufferSize in interface ProtonSslEnginepublic java.lang.String getCipherSuite()
getCipherSuite in interface ProtonSslEnginepublic java.lang.String getProtocol()
getProtocol in interface ProtonSslEnginepublic java.lang.Runnable getDelegatedTask()
getDelegatedTask in interface ProtonSslEnginepublic javax.net.ssl.SSLEngineResult.HandshakeStatus getHandshakeStatus()
getHandshakeStatus in interface ProtonSslEnginepublic boolean getUseClientMode()
getUseClientMode in interface ProtonSslEnginepublic java.lang.String toString()
toString in class java.lang.Object