SSLEngine API using OpenSSL's non-blocking interfaces.
| Modifier and Type | Field and Description |
|---|---|
| private ActiveSession | activeSession
Set during startHandshake. |
| private BufferAllocator | |
| private OpenSSLKey | channelIdPrivateKey
Private key for the TLS Channel ID extension. |
| private static final SSLEngineResult | |
| private SessionSnapshot | closedSession
A snapshot of the active session when the engine was closed. |
| private static BufferAllocator | |
| private final SSLSession | externalSession
The session object exposed externally from this class. |
| private boolean | |
| private HandshakeListener | |
| private ByteBuffer | lazyDirectBuffer
A lazy-created direct buffer used as a bridge between heap buffers provided by the application and JNI. |
| private int | |
| private static final SSLEngineResult | |
| private static final SSLEngineResult | |
| private static final SSLEngineResult | |
| private static final SSLEngineResult | |
| private final NativeSsl. | networkBio
The BIO used for reading/writing encrypted bytes. |
| private String | peerHostname
Hostname used with the TLS extension SNI hostname. |
| private final PeerInfoProvider | |
| private final ByteBuffer[] | |
| private final ByteBuffer[] | |
| private final NativeSsl | ssl
Wrapper around the underlying SSL object. |
| private final SSLParametersImpl | |
| private int |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv | |
| pack-priv | ConscryptEngine(SSLParametersImpl sslParameters, PeerInfoProvider peerInfoProvider, SSLParametersImpl.
|
| Modifier and Type | Method and Description |
|---|---|
| public void | beginHandshake()
Implements abstract javax. |
| private void | |
| private static int | |
| private static long | |
| public String | chooseClientAlias(X509KeyManager keyManager, X500Principal[] issuers, String[] keyTypes)
Implements org. |
| public String | chooseClientPSKIdentity(PSKKeyManager keyManager, String identityHint)
Implements org.
Deprecated
as a consequence of
PSKKeyManager being deprecated.
|
| public String | chooseServerAlias(X509KeyManager keyManager, String keyType)
Implements org. |
| public String | chooseServerPSKIdentityHint(PSKKeyManager keyManager)
Implements org.
Deprecated
as a consequence of
PSKKeyManager being deprecated.
|
| public void | clientCertificateRequested(byte[]
key types supported by the server,
convertible to strings with #keyType keyTypeBytes, int[] signatureAlgs, byte[][] CAs known to the server asn1DerEncodedPrincipals)Implements org. |
| public int | clientPSKKeyRequested(String
PSK identity hint provided by the server or identityHint, byte[] null if no hint
provided.buffer to be populated with PSK identity (NULL-terminated modified UTF-8)
by this method. This identity will be provided to the server. identity, byte[] buffer to be populated with key material by this method. key)Implements org. |
| private ClientSessionContext | |
| private void | |
| private void | |
| public void | closeInbound()
Implements abstract javax. SSLEngine.
|
| public void | closeOutbound()
Implements abstract javax. SSLEngine.
|
| private SSLException | |
| private long | |
| pack-priv byte[] | exportKeyingMaterial(String
the label to use in calculating the exported value. This must be
an ASCII-only string. label, byte[] the application-specific context value to use in calculating the
exported value. This may be context, int null to use no application context, which is
treated differently than an empty byte array.the number of bytes of keying material to return. length)Implements abstract org. |
| protected void | finalize()
Overrides java. |
| private void | |
| private void | |
| public String | getApplicationProtocol()
Implements abstract org. |
| pack-priv String[] | getApplicationProtocols()
Implements abstract org. |
| pack-priv byte[] | Returns: channel ID ornull if not available.Implements abstract org. |
| pack-priv static BufferAllocator | getDefaultBufferAllocator()
Returns the default |
| public Runnable | getDelegatedTask()
Implements abstract javax. Runnable task for
this SSLEngine.
|
| public String[] | getEnabledCipherSuites()
Implements abstract javax. |
| public String[] | getEnabledProtocols()
Implements abstract javax. SSLEngine.
|
| public boolean | getEnableSessionCreation()
Implements abstract javax. |
| private SSLEngineResult. | |
| public String | getHandshakeApplicationProtocol()
Implements abstract org. |
| public SSLEngineResult. | getHandshakeStatus()
Implements abstract javax. SSLEngine.
|
| private SSLEngineResult. | |
| private SSLEngineResult. | |
| pack-priv String | getHostname()
Implements abstract org. setHostname(String) or supplied by the
PeerInfoProvider upon creation.
|
| public boolean | getNeedClientAuth()
Implements abstract javax. |
| private ByteBuffer | |
| public String | getPeerHost()
Implements abstract org. |
| public int | getPeerPort()
Implements abstract org. |
| public SecretKey | getPSKKey(PSKKeyManager keyManager, String identityHint, String identity)
Implements org.
Deprecated
as a consequence of
PSKKeyManager being deprecated.
|
| public SSLSession | getSession()
Implements abstract javax. SSLSession in use in this
SSLEngine.
|
| public SSLParameters | getSSLParameters()
Overrides javax. |
| public String[] | getSupportedCipherSuites()
Implements abstract javax. |
| public String[] | getSupportedProtocols()
Implements abstract javax. SSLEngine.
|
| pack-priv byte[] | getTlsUnique()
Implements abstract org. |
| public boolean | getUseClientMode()
Implements abstract javax. |
| public boolean | getWantClientAuth()
Implements abstract javax. |
| private SSLEngineResult. | |
| pack-priv SSLSession | handshakeSession()
Implements abstract org. |
| private boolean | |
| public boolean | isInboundDone()
Implements abstract javax. unwrap(ByteBuffer, ByteBuffer) will
accept any more inbound data messages.
|
| public boolean | isOutboundDone()
Implements abstract javax. wrap(ByteBuffer, ByteBuffer) will
produce any more outbound data messages.
|
| pack-priv int | maxSealOverhead()
Implements abstract org. |
| private SSLEngineResult. | |
| private SSLEngineResult | |
| private static NativeSsl | newSsl(SSLParametersImpl sslParameters, ConscryptEngine engine, SSLParametersImpl.
|
| private SSLException | |
| public void | onNewSessionEstablished(long sslSessionNativePtr)
Implements org. |
| public void | onSSLStateChange(int type, int val)
Implements org. |
| private int | |
| pack-priv int | |
| private static SSLEngineResult. | |
| private ConscryptSession | |
| private ConscryptSession | |
| private ConscryptSession | |
| private int | readEncryptedData(final ByteBuffer dst, final int pending)
Read encrypted data from the OpenSSL network BIO |
| private int | |
| private int | |
| private SSLEngineResult | readPendingBytesFromBIO(ByteBuffer dst, int bytesConsumed, int bytesProduced, SSLEngineResult.
|
| private int | |
| private int | |
| private int | |
| private void | |
| private void | |
| public int | selectApplicationProtocol(byte[]
list of application protocols in length-prefix format protocols)Implements org. ApplicationProtocolSelectorAdapter associated with it, and the application protocol
needs to be selected.
|
| private void | |
| public void | serverCertificateRequested()
Implements org. |
| public int | serverPSKKeyRequested(String
PSK identity hint provided by this server to the client or
identityHint, String null if no hint was provided.PSK identity provided by the client. identity, byte[] buffer to be populated with key material by this method. key)Implements org. |
| public long | serverSessionRequested(byte[]
the ID of the session to find. id)Implements org. |
| private AbstractSessionContext | |
| pack-priv void | setApplicationProtocols(String[]
the list of ALPN protocols protocols)Implements abstract org. |
| pack-priv void | setApplicationProtocolSelector(ApplicationProtocolSelector selector)
Implements abstract org. |
| pack-priv void | |
| pack-priv void | setBufferAllocator(BufferAllocator bufferAllocator)
Implements abstract org. |
| pack-priv void | setChannelIdEnabled(boolean enabled)
Implements abstract org. |
| pack-priv void | setChannelIdPrivateKey(PrivateKey
private key (enables TLS Channel ID) or privateKey)null for no key (disables
TLS Channel ID). The private key must be an Elliptic Curve (EC) key based on the NIST
P-256 curve (aka SECG secp256r1 or ANSI X9.62 prime256v1).Implements abstract org. PrivateKey to be used for TLS Channel ID by this client engine.
|
| pack-priv static void | setDefaultBufferAllocator(BufferAllocator bufferAllocator)
Configures the default |
| public void | setEnabledCipherSuites(String[]
Names of all the cipher suites to enable suites)Implements abstract javax. |
| public void | setEnabledProtocols(String[]
Names of all the protocols to enable. protocols)Implements abstract javax. |
| public void | setEnableSessionCreation(boolean
true indicates that sessions may be created; this
is the default. false indicates that an existing session
must be resumed flag)Implements abstract javax. |
| pack-priv void | setHandshakeListener(HandshakeListener handshakeListener)
Implements abstract org. |
| pack-priv void | setHostname(String hostname)
Implements abstract org. PeerInfoProvider
supplied during engine creation.
|
| public void | setNeedClientAuth(boolean
set to true if client authentication is required,
or false if no client authentication is desired. need)Implements abstract javax. |
| public void | setSSLParameters(SSLParameters
the parameters p)Overrides javax. |
| public void | setUseClientMode(boolean
true if the engine should start its handshaking
in "client" mode mode)Implements abstract javax. |
| pack-priv void | setUseSessionTickets(boolean
True to enable session tickets useSessionTickets)Implements abstract org. |
| public void | setWantClientAuth(boolean
set to true if client authentication is requested,
or false if no client authentication is desired. want)Implements abstract javax. |
| private ByteBuffer[] | |
| private ByteBuffer[] | |
| private void | |
| public SSLEngineResult | unwrap(ByteBuffer
a src, ByteBuffer ByteBuffer containing inbound network data.a dst)ByteBuffer to hold inbound application data.Implements abstract org. |
| public SSLEngineResult | unwrap(ByteBuffer
a src, ByteBuffer[] ByteBuffer containing inbound network data.an array of dsts)ByteBuffers to hold inbound
application data.Implements abstract org. |
| public SSLEngineResult | unwrap(final ByteBuffer
a src, final ByteBuffer[] ByteBuffer containing inbound network data.an array of dsts, final int ByteBuffers to hold inbound
application data.The offset within the buffer array of the first buffer from
which bytes are to be transferred; it must be non-negative
and no larger than offset, final int dsts.length.The maximum number of buffers to be accessed; it must be
non-negative and no larger than
length)dsts.length - offset.Implements abstract org. |
| pack-priv SSLEngineResult | unwrap(final ByteBuffer[] srcs, final ByteBuffer[] dsts)
Implements abstract org. |
| pack-priv SSLEngineResult | unwrap(final ByteBuffer[] srcs, int srcsOffset, final int srcsLength, final ByteBuffer[] dsts, final int dstsOffset, final int dstsLength)
Implements abstract org. |
| public void | verifyCertificateChain(byte[][]
chain of X.509 certificates in their encoded form certChain, String auth algorithm name authMethod)Implements org. |
| public SSLEngineResult | wrap(ByteBuffer
a src, ByteBuffer ByteBuffer containing outbound application dataa dst)ByteBuffer to hold outbound network dataImplements abstract org. |
| public SSLEngineResult | wrap(ByteBuffer[]
an array of srcs, int ByteBuffers containing the
outbound application dataThe offset within the buffer array of the first buffer from
which bytes are to be retrieved; it must be non-negative
and no larger than srcsOffset, int srcs.lengthThe maximum number of buffers to be accessed; it must be
non-negative and no larger than
srcsLength, ByteBuffer srcs.length - offseta dst)ByteBuffer to hold outbound network dataImplements abstract org. |
| private int | |
| private int | |
| private int | |
| private int | writePlaintextData(final ByteBuffer src, int len)
Write plaintext data to the OpenSSL internal BIO Calling this function with src.remaining == 0 is undefined. |
| private int | |
| private int |