ConscryptEngine

Implements the {@link SSLEngine} API using OpenSSL's non-blocking interfaces. , SSLParametersImpl.AliasChooser, SSLParametersImpl.PSKCallbacks

version(WITH_HUNT_SECURITY)
final
class ConscryptEngine : AbstractConscryptEngine , SSLHandshakeCallbacks {}

Constructors

this
this(SSLParametersImpl sslParameters)
Undocumented in source.
this
this(string host, int port, SSLParametersImpl sslParameters)
Undocumented in source.

Members

Aliases

wrap
alias wrap = SSLEngine.wrap
Undocumented in source.

Functions

beginHandshake
void beginHandshake()
Undocumented in source. Be warned that the author may not have intended to support it.
clientCertificateRequested
void clientCertificateRequested(byte[] keyTypeBytes, byte[][] asn1DerEncodedPrincipals)
Undocumented in source. Be warned that the author may not have intended to support it.
clientPSKKeyRequested
int clientPSKKeyRequested(string identityHint, byte[] identity, byte[] key)
Undocumented in source. Be warned that the author may not have intended to support it.
closeInbound
void closeInbound()
Undocumented in source. Be warned that the author may not have intended to support it.
closeOutbound
void closeOutbound()
Undocumented in source. Be warned that the author may not have intended to support it.
getApplicationProtocol
string getApplicationProtocol()
Undocumented in source. Be warned that the author may not have intended to support it.
getApplicationProtocols
string[] getApplicationProtocols()
Undocumented in source. Be warned that the author may not have intended to support it.
getEnableSessionCreation
bool getEnableSessionCreation()
Undocumented in source. Be warned that the author may not have intended to support it.
getEnabledCipherSuites
string[] getEnabledCipherSuites()
Undocumented in source. Be warned that the author may not have intended to support it.
getEnabledProtocols
string[] getEnabledProtocols()
Undocumented in source. Be warned that the author may not have intended to support it.
getHandshakeApplicationProtocol
string getHandshakeApplicationProtocol()
Undocumented in source. Be warned that the author may not have intended to support it.
getHandshakeStatus
HandshakeStatus getHandshakeStatus()
Undocumented in source. Be warned that the author may not have intended to support it.
getHostname
string getHostname()

Returns the hostname from {@link #setHostname(string)} or supplied by the {@link PeerInfoProvider} upon creation. No DNS resolution is attempted before returning the hostname.

getNeedClientAuth
bool getNeedClientAuth()
Undocumented in source. Be warned that the author may not have intended to support it.
getPeerHost
string getPeerHost()
Undocumented in source. Be warned that the author may not have intended to support it.
getPeerPort
int getPeerPort()
Undocumented in source. Be warned that the author may not have intended to support it.
getSession
SSLSession getSession()
Undocumented in source. Be warned that the author may not have intended to support it.
getSupportedCipherSuites
string[] getSupportedCipherSuites()
Undocumented in source. Be warned that the author may not have intended to support it.
getSupportedProtocols
string[] getSupportedProtocols()
Undocumented in source. Be warned that the author may not have intended to support it.
getUseClientMode
bool getUseClientMode()
Undocumented in source. Be warned that the author may not have intended to support it.
getWantClientAuth
bool getWantClientAuth()
Undocumented in source. Be warned that the author may not have intended to support it.
handshakeSession
SSLSession handshakeSession()

Work-around to allow this method to be called on older versions of Android.

isInboundDone
bool isInboundDone()
Undocumented in source. Be warned that the author may not have intended to support it.
isOutboundDone
bool isOutboundDone()
Undocumented in source. Be warned that the author may not have intended to support it.
maxSealOverhead
int maxSealOverhead()

Returns the maximum overhead, in bytes, of sealing a record with SSL.

onNewSessionEstablished
void onNewSessionEstablished(long sslSessionNativePtr)
Undocumented in source. Be warned that the author may not have intended to support it.
onSSLStateChange
void onSSLStateChange(int type, int val)
Undocumented in source. Be warned that the author may not have intended to support it.
serverPSKKeyRequested
int serverPSKKeyRequested(string identityHint, string identity, byte[] key)
Undocumented in source. Be warned that the author may not have intended to support it.
serverSessionRequested
long serverSessionRequested(byte[] id)
Undocumented in source. Be warned that the author may not have intended to support it.
setApplicationProtocolSelector
void setApplicationProtocolSelector(ApplicationProtocolSelector selector)
Undocumented in source. Be warned that the author may not have intended to support it.
setApplicationProtocolSelector
void setApplicationProtocolSelector(ApplicationProtocolSelectorAdapter adapter)
Undocumented in source. Be warned that the author may not have intended to support it.
setApplicationProtocols
void setApplicationProtocols(string[] protocols)
Undocumented in source. Be warned that the author may not have intended to support it.
setEnableSessionCreation
void setEnableSessionCreation(bool flag)
Undocumented in source. Be warned that the author may not have intended to support it.
setEnabledCipherSuites
void setEnabledCipherSuites(string[] suites)
Undocumented in source. Be warned that the author may not have intended to support it.
setEnabledProtocols
void setEnabledProtocols(string[] protocols)
Undocumented in source. Be warned that the author may not have intended to support it.
setHandshakeListener
void setHandshakeListener(HandshakeListener handshakeListener)

Sets the listener for the completion of the TLS handshake.

setHostname
void setHostname(string hostname)

This method enables Server Name Indication (SNI) and overrides the {@link PeerInfoProvider} supplied during engine creation. If the hostname is not a valid SNI hostname, the SNI extension will be omitted from the handshake.

setNeedClientAuth
void setNeedClientAuth(bool need)
Undocumented in source. Be warned that the author may not have intended to support it.
setUseClientMode
void setUseClientMode(bool mode)
Undocumented in source. Be warned that the author may not have intended to support it.
setUseSessionTickets
void setUseSessionTickets(bool useSessionTickets)

This method enables session ticket support.

setWantClientAuth
void setWantClientAuth(bool want)
Undocumented in source. Be warned that the author may not have intended to support it.
unwrap
SSLEngineResult unwrap(ByteBuffer src, ByteBuffer dst)
Undocumented in source. Be warned that the author may not have intended to support it.
unwrap
SSLEngineResult unwrap(ByteBuffer src, ByteBuffer[] dsts)
Undocumented in source. Be warned that the author may not have intended to support it.
unwrap
SSLEngineResult unwrap(ByteBuffer src, ByteBuffer[] dsts, int offset, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
unwrap
SSLEngineResult unwrap(ByteBuffer[] srcs, ByteBuffer[] dsts)
Undocumented in source. Be warned that the author may not have intended to support it.
unwrap
SSLEngineResult unwrap(ByteBuffer[] srcs, int srcsOffset, int srcsLength, ByteBuffer[] dsts, int dstsOffset, int dstsLength)
Undocumented in source. Be warned that the author may not have intended to support it.
verifyCertificateChain
void verifyCertificateChain(byte[][] certChain, string authMethod)
Undocumented in source. Be warned that the author may not have intended to support it.
wrap
SSLEngineResult wrap(ByteBuffer src, ByteBuffer dst)
Undocumented in source. Be warned that the author may not have intended to support it.
wrap
SSLEngineResult wrap(ByteBuffer[] srcs, int srcsOffset, int srcsLength, ByteBuffer dst)
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

checkPositionIndexes
void checkPositionIndexes(int start, int end, int size)

Ensures that {@code start} and {@code end} specify a valid <i>positions</i> in an array, list or string of size {@code size}, and are in order. A position index may range from zero to {@code size}, inclusive.

Inherited Members

From AbstractConscryptEngine

maxSealOverhead
int maxSealOverhead()

Returns the maximum overhead, in bytes, of sealing a record with SSL.

setHandshakeListener
void setHandshakeListener(HandshakeListener handshakeListener)

Sets the listener for the completion of the TLS handshake.

setHostname
void setHostname(string hostname)

This method enables Server Name Indication (SNI) and overrides the {@link PeerInfoProvider} supplied during engine creation.

getHostname
string getHostname()

Returns the hostname from {@link #setHostname(string)} or supplied by the {@link PeerInfoProvider} upon creation. No DNS resolution is attempted before returning the hostname.

getPeerHost
string getPeerHost()
Undocumented in source.
getPeerPort
int getPeerPort()
Undocumented in source.
handshakeSession
SSLSession handshakeSession()

Work-around to allow this method to be called on older versions of Android.

unwrap
SSLEngineResult unwrap(ByteBuffer src, ByteBuffer dst)
Undocumented in source.
unwrap
SSLEngineResult unwrap(ByteBuffer src, ByteBuffer[] dsts)
Undocumented in source.
unwrap
SSLEngineResult unwrap(ByteBuffer src, ByteBuffer[] dsts, int offset, int length)
Undocumented in source.
unwrap
SSLEngineResult unwrap(ByteBuffer[] srcs, ByteBuffer[] dsts)
Undocumented in source.
unwrap
SSLEngineResult unwrap(ByteBuffer[] srcs, int srcsOffset, int srcsLength, ByteBuffer[] dsts, int dstsOffset, int dstsLength)
Undocumented in source.
wrap
SSLEngineResult wrap(ByteBuffer src, ByteBuffer dst)
Undocumented in source.
wrap
SSLEngineResult wrap(ByteBuffer[] srcs, int srcsOffset, int srcsLength, ByteBuffer dst)
Undocumented in source.
setUseSessionTickets
void setUseSessionTickets(bool useSessionTickets)

This method enables session ticket support.

setApplicationProtocols
void setApplicationProtocols(string[] protocols)

Sets the list of ALPN protocols.

getApplicationProtocols
string[] getApplicationProtocols()

Returns the list of supported ALPN protocols.

getApplicationProtocol
string getApplicationProtocol()
Undocumented in source.
getHandshakeApplicationProtocol
string getHandshakeApplicationProtocol()
Undocumented in source.
setApplicationProtocolSelector
void setApplicationProtocolSelector(ApplicationProtocolSelector selector)
Undocumented in source.

From SSLHandshakeCallbacks

verifyCertificateChain
void verifyCertificateChain(byte[][] certificateChain, string authMethod)

Verify that the certificate chain is trusted.

clientCertificateRequested
void clientCertificateRequested(byte[] keyTypes, byte[][] asn1DerEncodedX500Principals)

Called on an SSL client when the server requests (or requires a certificate). The client can respond by using SSL_use_certificate and SSL_use_PrivateKey to set a certificate if has an appropriate one available, similar to how the server provides its certificate.

clientPSKKeyRequested
int clientPSKKeyRequested(string identityHint, byte[] identity, byte[] key)

Gets the key to be used in client mode for this connection in Pre-Shared Key (PSK) key exchange.

serverPSKKeyRequested
int serverPSKKeyRequested(string identityHint, string identity, byte[] key)

Gets the key to be used in server mode for this connection in Pre-Shared Key (PSK) key exchange.

onSSLStateChange
void onSSLStateChange(int type, int val)

Called when SSL state changes. This could be handshake completion.

onNewSessionEstablished
void onNewSessionEstablished(long sslSessionNativePtr)

Called when a new session has been established and may be added to the session cache. The callee is responsible for incrementing the reference count on the returned session.

serverSessionRequested
long serverSessionRequested(byte[] id)

Called for servers where TLS < 1.3 (TLS 1.3 uses session tickets rather than application session caches).

Meta