public class ReferenceCountedOpenSslEngine extends javax.net.ssl.SSLEngine implements ReferenceCounted
SSLEngine using
OpenSSL BIO abstractions.
Instances of this class must be released or else native memory will leak!
Instances of this class must be released before the ReferenceCountedOpenSslContext
the instance depends upon are released. Otherwise if any method of this class is called which uses the
the ReferenceCountedOpenSslContext JNI resources the JVM may crash.
| 限定符和类型 | 方法和说明 |
|---|---|
void |
beginHandshake() |
void |
closeInbound() |
void |
closeOutbound() |
java.lang.String |
getApplicationProtocol() |
java.lang.Runnable |
getDelegatedTask() |
java.lang.String[] |
getEnabledCipherSuites() |
java.lang.String[] |
getEnabledProtocols() |
boolean |
getEnableSessionCreation() |
java.lang.String |
getHandshakeApplicationProtocol() |
javax.net.ssl.SSLSession |
getHandshakeSession() |
javax.net.ssl.SSLEngineResult.HandshakeStatus |
getHandshakeStatus() |
boolean |
getNeedClientAuth() |
java.lang.String |
getNegotiatedApplicationProtocol()
Returns the name of the negotiated application-level protocol.
|
byte[] |
getOcspResponse()
Returns the OCSP response or
null if the server didn't provide a stapled OCSP response. |
javax.net.ssl.SSLSession |
getSession() |
javax.net.ssl.SSLParameters |
getSSLParameters() |
java.lang.String[] |
getSupportedCipherSuites() |
java.lang.String[] |
getSupportedProtocols() |
boolean |
getUseClientMode() |
boolean |
getWantClientAuth() |
boolean |
isInboundDone() |
boolean |
isOutboundDone() |
int |
refCnt()
Returns the reference count of this object.
|
boolean |
release()
Decreases the reference count by
1 and deallocates this object if the reference count reaches at
0. |
boolean |
release(int decrement)
Decreases the reference count by the specified
decrement and deallocates this object if the reference
count reaches at 0. |
ReferenceCounted |
retain()
Increases the reference count by
1. |
ReferenceCounted |
retain(int increment)
Increases the reference count by the specified
increment. |
void |
setEnabledCipherSuites(java.lang.String[] cipherSuites) |
void |
setEnabledProtocols(java.lang.String[] protocols)
TLS doesn't support a way to advertise non-contiguous versions from the client's perspective, and the client
just advertises the max supported version.
|
void |
setEnableSessionCreation(boolean b) |
void |
setNeedClientAuth(boolean b) |
void |
setOcspResponse(byte[] response)
Sets the OCSP response.
|
void |
setSSLParameters(javax.net.ssl.SSLParameters sslParameters) |
void |
setUseClientMode(boolean clientMode) |
void |
setVerify(int verifyMode,
int depth)
See SSL_set_verify and
SSL#setVerify(long, int, int). |
void |
setWantClientAuth(boolean b) |
void |
shutdown()
Destroys this engine.
|
long |
sslPointer()
Returns the pointer to the
SSL object for this ReferenceCountedOpenSslEngine. |
ReferenceCounted |
touch()
Records the current access location of this object for debugging purposes.
|
ReferenceCounted |
touch(java.lang.Object hint)
Records the current access location of this object with an additional arbitrary information for debugging
purposes.
|
javax.net.ssl.SSLEngineResult |
unwrap(java.nio.ByteBuffer[] srcs,
java.nio.ByteBuffer[] dsts) |
javax.net.ssl.SSLEngineResult |
unwrap(java.nio.ByteBuffer[] srcs,
int srcsOffset,
int srcsLength,
java.nio.ByteBuffer[] dsts,
int dstsOffset,
int dstsLength) |
javax.net.ssl.SSLEngineResult |
unwrap(java.nio.ByteBuffer src,
java.nio.ByteBuffer dst) |
javax.net.ssl.SSLEngineResult |
unwrap(java.nio.ByteBuffer src,
java.nio.ByteBuffer[] dsts) |
javax.net.ssl.SSLEngineResult |
unwrap(java.nio.ByteBuffer src,
java.nio.ByteBuffer[] dsts,
int offset,
int length) |
javax.net.ssl.SSLEngineResult |
wrap(java.nio.ByteBuffer[] srcs,
int offset,
int length,
java.nio.ByteBuffer dst) |
javax.net.ssl.SSLEngineResult |
wrap(java.nio.ByteBuffer src,
java.nio.ByteBuffer dst) |
@UnstableApi public void setOcspResponse(byte[] response)
@UnstableApi public byte[] getOcspResponse()
null if the server didn't provide a stapled OCSP response.public final int refCnt()
ReferenceCounted0, it means this object has been deallocated.refCnt 在接口中 ReferenceCountedpublic final ReferenceCounted retain()
ReferenceCounted1.retain 在接口中 ReferenceCountedpublic final ReferenceCounted retain(int increment)
ReferenceCountedincrement.retain 在接口中 ReferenceCountedpublic final ReferenceCounted touch()
ReferenceCountedResourceLeakDetector. This method is a shortcut to touch(null).touch 在接口中 ReferenceCountedpublic final ReferenceCounted touch(java.lang.Object hint)
ReferenceCountedResourceLeakDetector.touch 在接口中 ReferenceCountedpublic final boolean release()
ReferenceCounted1 and deallocates this object if the reference count reaches at
0.release 在接口中 ReferenceCountedtrue if and only if the reference count became 0 and this object has been deallocatedpublic final boolean release(int decrement)
ReferenceCounteddecrement and deallocates this object if the reference
count reaches at 0.release 在接口中 ReferenceCountedtrue if and only if the reference count became 0 and this object has been deallocatedpublic java.lang.String getApplicationProtocol()
public java.lang.String getHandshakeApplicationProtocol()
public final javax.net.ssl.SSLSession getHandshakeSession()
getHandshakeSession 在类中 javax.net.ssl.SSLEnginepublic final long sslPointer()
SSL object for this ReferenceCountedOpenSslEngine.
Be aware that it is freed as soon as the release() or shutdown() methods are called.
At this point 0 will be returned.public final void shutdown()
public final javax.net.ssl.SSLEngineResult wrap(java.nio.ByteBuffer[] srcs,
int offset,
int length,
java.nio.ByteBuffer dst)
throws javax.net.ssl.SSLException
wrap 在类中 javax.net.ssl.SSLEnginejavax.net.ssl.SSLExceptionpublic final javax.net.ssl.SSLEngineResult unwrap(java.nio.ByteBuffer[] srcs,
int srcsOffset,
int srcsLength,
java.nio.ByteBuffer[] dsts,
int dstsOffset,
int dstsLength)
throws javax.net.ssl.SSLException
javax.net.ssl.SSLExceptionpublic final javax.net.ssl.SSLEngineResult unwrap(java.nio.ByteBuffer[] srcs,
java.nio.ByteBuffer[] dsts)
throws javax.net.ssl.SSLException
javax.net.ssl.SSLExceptionpublic final javax.net.ssl.SSLEngineResult unwrap(java.nio.ByteBuffer src,
java.nio.ByteBuffer[] dsts,
int offset,
int length)
throws javax.net.ssl.SSLException
unwrap 在类中 javax.net.ssl.SSLEnginejavax.net.ssl.SSLExceptionpublic final javax.net.ssl.SSLEngineResult wrap(java.nio.ByteBuffer src,
java.nio.ByteBuffer dst)
throws javax.net.ssl.SSLException
wrap 在类中 javax.net.ssl.SSLEnginejavax.net.ssl.SSLExceptionpublic final javax.net.ssl.SSLEngineResult unwrap(java.nio.ByteBuffer src,
java.nio.ByteBuffer dst)
throws javax.net.ssl.SSLException
unwrap 在类中 javax.net.ssl.SSLEnginejavax.net.ssl.SSLExceptionpublic final javax.net.ssl.SSLEngineResult unwrap(java.nio.ByteBuffer src,
java.nio.ByteBuffer[] dsts)
throws javax.net.ssl.SSLException
unwrap 在类中 javax.net.ssl.SSLEnginejavax.net.ssl.SSLExceptionpublic final java.lang.Runnable getDelegatedTask()
getDelegatedTask 在类中 javax.net.ssl.SSLEnginepublic final void closeInbound()
throws javax.net.ssl.SSLException
closeInbound 在类中 javax.net.ssl.SSLEnginejavax.net.ssl.SSLExceptionpublic final boolean isInboundDone()
isInboundDone 在类中 javax.net.ssl.SSLEnginepublic final void closeOutbound()
closeOutbound 在类中 javax.net.ssl.SSLEnginepublic final boolean isOutboundDone()
isOutboundDone 在类中 javax.net.ssl.SSLEnginepublic final java.lang.String[] getSupportedCipherSuites()
getSupportedCipherSuites 在类中 javax.net.ssl.SSLEnginepublic final java.lang.String[] getEnabledCipherSuites()
getEnabledCipherSuites 在类中 javax.net.ssl.SSLEnginepublic final void setEnabledCipherSuites(java.lang.String[] cipherSuites)
setEnabledCipherSuites 在类中 javax.net.ssl.SSLEnginepublic final java.lang.String[] getSupportedProtocols()
getSupportedProtocols 在类中 javax.net.ssl.SSLEnginepublic final java.lang.String[] getEnabledProtocols()
getEnabledProtocols 在类中 javax.net.ssl.SSLEnginepublic final void setEnabledProtocols(java.lang.String[] protocols)
setEnabledProtocols 在类中 javax.net.ssl.SSLEnginepublic final javax.net.ssl.SSLSession getSession()
getSession 在类中 javax.net.ssl.SSLEnginepublic final void beginHandshake()
throws javax.net.ssl.SSLException
beginHandshake 在类中 javax.net.ssl.SSLEnginejavax.net.ssl.SSLExceptionpublic final javax.net.ssl.SSLEngineResult.HandshakeStatus getHandshakeStatus()
getHandshakeStatus 在类中 javax.net.ssl.SSLEnginepublic final void setUseClientMode(boolean clientMode)
setUseClientMode 在类中 javax.net.ssl.SSLEnginepublic final boolean getUseClientMode()
getUseClientMode 在类中 javax.net.ssl.SSLEnginepublic final void setNeedClientAuth(boolean b)
setNeedClientAuth 在类中 javax.net.ssl.SSLEnginepublic final boolean getNeedClientAuth()
getNeedClientAuth 在类中 javax.net.ssl.SSLEnginepublic final void setWantClientAuth(boolean b)
setWantClientAuth 在类中 javax.net.ssl.SSLEnginepublic final boolean getWantClientAuth()
getWantClientAuth 在类中 javax.net.ssl.SSLEngine@UnstableApi public final void setVerify(int verifyMode, int depth)
SSL#setVerify(long, int, int).public final void setEnableSessionCreation(boolean b)
setEnableSessionCreation 在类中 javax.net.ssl.SSLEnginepublic final boolean getEnableSessionCreation()
getEnableSessionCreation 在类中 javax.net.ssl.SSLEnginepublic final javax.net.ssl.SSLParameters getSSLParameters()
getSSLParameters 在类中 javax.net.ssl.SSLEnginepublic final void setSSLParameters(javax.net.ssl.SSLParameters sslParameters)
setSSLParameters 在类中 javax.net.ssl.SSLEnginepublic java.lang.String getNegotiatedApplicationProtocol()
null if the negotiation failed or the client does not have ALPN/NPN extension