SSLEngine classes.
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv abstract byte[] | Returns: a value of the specified length, ornull if the handshake has not yet
completed or the connection has been closed.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)Exports a value derived from the TLS master secret as described in RFC 5705. |
| public abstract String | getApplicationProtocol()
Returns the most recent application protocol value negotiated for this
connection.
|
| pack-priv abstract String[] | |
| pack-priv abstract byte[] | Returns: channel ID ornull if not available.Gets the TLS Channel ID for this server engine. |
| public abstract String | getHandshakeApplicationProtocol()
Overrides javax. |
| public final SSLSession | getHandshakeSession()
Overrides javax. SSLSession being constructed during a SSL/TLS/DTLS
handshake.
|
| pack-priv abstract String | getHostname()
Returns the hostname from |
| public abstract String | |
| public abstract int | |
| pack-priv abstract byte[] | |
| pack-priv abstract SSLSession | |
| pack-priv abstract int | |
| pack-priv abstract void | setApplicationProtocols(String[]
the list of ALPN protocols protocols)Sets the list of ALPN protocols. |
| pack-priv abstract void | setApplicationProtocolSelector(ApplicationProtocolSelector selector)
Sets an application-provided ALPN protocol selector. |
| pack-priv abstract void | |
| pack-priv abstract void | |
| pack-priv abstract 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).Sets the |
| pack-priv abstract void | setHandshakeListener(HandshakeListener handshakeListener)
Sets the listener for the completion of the TLS handshake. |
| pack-priv abstract void | setHostname(String hostname)
This method enables Server Name Indication (SNI) and overrides the |
| pack-priv abstract void | setUseSessionTickets(boolean
True to enable session tickets useSessionTickets)This method enables session ticket support. |
| public abstract SSLEngineResult | unwrap(ByteBuffer
a src, ByteBuffer ByteBuffer containing inbound network data.a dst)ByteBuffer to hold inbound application data.Overrides javax. |
| public abstract SSLEngineResult | unwrap(ByteBuffer
a src, ByteBuffer[] ByteBuffer containing inbound network data.an array of dsts)ByteBuffers to hold inbound
application data.Overrides javax. |
| public abstract 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 javax. |
| pack-priv abstract SSLEngineResult | |
| pack-priv abstract SSLEngineResult | unwrap(final ByteBuffer[] srcs, int srcsOffset, final int srcsLength, final ByteBuffer[] dsts, final int dstsOffset, final int dstsLength)
|
| public abstract SSLEngineResult | wrap(ByteBuffer
a src, ByteBuffer ByteBuffer containing outbound application dataa dst)ByteBuffer to hold outbound network dataOverrides javax. |
| public abstract 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 javax. |
| AbstractConscryptEngine | back to summary |
|---|---|
| pack-priv AbstractConscryptEngine() | |
| exportKeyingMaterial | back to summary |
|---|---|
| pack-priv abstract byte[] exportKeyingMaterial(String label, byte[] context, int length) throws SSLException Exports a value derived from the TLS master secret as described in RFC 5705.
| |
| getApplicationProtocol | back to summary |
|---|---|
| public abstract String getApplicationProtocol() Overrides javax. Doc from javax. Returns the most recent application protocol value negotiated for this connection. If supported by the underlying SSL/TLS/DTLS implementation, application name negotiation mechanisms such as RFC 7301 , the Application-Layer Protocol Negotiation (ALPN), can negotiate application-level values between peers.
| |
| getApplicationProtocols | back to summary |
|---|---|
| pack-priv abstract String[] getApplicationProtocols() Returns the list of supported ALPN protocols. | |
| getChannelId | back to summary |
|---|---|
| pack-priv abstract byte[] getChannelId() throws SSLException Gets the TLS Channel ID for this server engine. Channel ID is only available once the handshake completes.
| |
| getHandshakeApplicationProtocol | back to summary |
|---|---|
| public abstract String getHandshakeApplicationProtocol() Overrides javax. Doc from javax. Returns the application protocol value negotiated on a SSL/TLS handshake currently in progress.
Like
| |
| getHandshakeSession | back to summary |
|---|---|
| public final SSLSession getHandshakeSession() Overrides javax. Doc from javax. Returns the
TLS/DTLS protocols may negotiate parameters that are needed when using
an instance of this class, but before the
This method provides early access to the
| |
| getHostname | back to summary |
|---|---|
| pack-priv abstract String getHostname() Returns the hostname from | |
| getPeerHost | back to summary |
|---|---|
| public abstract String getPeerHost() Overrides javax. Doc from javax. Returns the host name of the peer. Note that the value is not authenticated, and should not be relied upon. | |
| getPeerPort | back to summary |
|---|---|
| public abstract int getPeerPort() Overrides javax. Doc from javax. Returns the port number of the peer. Note that the value is not authenticated, and should not be relied upon.
| |
| getTlsUnique | back to summary |
|---|---|
| pack-priv abstract byte[] getTlsUnique() Returns the tls-unique channel binding value for this connection, per RFC 5929. This
will return | |
| handshakeSession | back to summary |
|---|---|
| pack-priv abstract SSLSession handshakeSession() Work-around to allow this method to be called on older versions of Android. | |
| maxSealOverhead | back to summary |
|---|---|
| pack-priv abstract int maxSealOverhead() Returns the maximum overhead, in bytes, of sealing a record with SSL. | |
| setApplicationProtocols | back to summary |
|---|---|
| pack-priv abstract void setApplicationProtocols(String[] protocols) Sets the list of ALPN protocols.
| |
| setApplicationProtocolSelector | back to summary |
|---|---|
| pack-priv abstract void setApplicationProtocolSelector(ApplicationProtocolSelector selector) Sets an application-provided ALPN protocol selector. If provided, this will override
the list of protocols set by | |
| setBufferAllocator | back to summary |
|---|---|
| pack-priv abstract void setBufferAllocator(BufferAllocator bufferAllocator) | |
| setChannelIdEnabled | back to summary |
|---|---|
| pack-priv abstract void setChannelIdEnabled(boolean enabled) Enables/disables TLS Channel ID for this server engine. This method needs to be invoked before the handshake starts.
| |
| setChannelIdPrivateKey | back to summary |
|---|---|
| pack-priv abstract void setChannelIdPrivateKey(PrivateKey privateKey) Sets the This method needs to be invoked before the handshake starts.
| |
| setHandshakeListener | back to summary |
|---|---|
| pack-priv abstract void setHandshakeListener(HandshakeListener handshakeListener) Sets the listener for the completion of the TLS handshake. | |
| setHostname | back to summary |
|---|---|
| pack-priv abstract void setHostname(String hostname) This method enables Server Name Indication (SNI) and overrides the | |
| setUseSessionTickets | back to summary |
|---|---|
| pack-priv abstract void setUseSessionTickets(boolean useSessionTickets) This method enables session ticket support.
| |
| unwrap | back to summary |
|---|---|
| public abstract SSLEngineResult unwrap(ByteBuffer src, ByteBuffer dst) throws SSLException Overrides javax. Doc from javax. Attempts to decode SSL/TLS/DTLS network data into a plaintext application data buffer. An invocation of this method behaves in exactly the same manner as the invocation:
| |
| unwrap | back to summary |
|---|---|
| public abstract SSLEngineResult unwrap(ByteBuffer src, ByteBuffer[] dsts) throws SSLException Overrides javax. Doc from javax. Attempts to decode SSL/TLS/DTLS network data into a sequence of plaintext application data buffers. An invocation of this method behaves in exactly the same manner as the invocation:
| |
| unwrap | back to summary |
|---|---|
| public abstract SSLEngineResult unwrap(final ByteBuffer src, final ByteBuffer[] dsts, final int offset, final int length) throws SSLException Implements abstract javax. Doc from javax. Attempts to decode SSL/TLS/DTLS network data into a subsequence of
plaintext application data buffers. This "scattering"
operation decodes, in a single invocation, a sequence of bytes
into one or more of a given sequence of buffers. Scattering
unwraps are often useful when implementing network protocols or
file formats that, for example, group data into segments
consisting of one or more fixed-length headers followed by a
variable-length body. See
Depending on the state of the SSLEngine, this method may consume network data without producing any application data (for example, it may consume handshake data.) The application is responsible for reliably obtaining the network data from the peer, and for invoking unwrap() on the data in the order it was received. The application must properly synchronize multiple calls to this method.
If this
This method will attempt to consume one complete SSL/TLS/DTLS network
packet, but will never consume more than the sum of the bytes
remaining in the buffers. Each
The underlying memory used by the
The inbound network buffer, Note the network data will not be useful to a second SSLEngine, as each SSLEngine contains unique random state which influences the SSL/TLS/DTLS messages. See the class description for more information on engine closure.
| |
| unwrap | back to summary |
|---|---|
| pack-priv abstract SSLEngineResult unwrap(final ByteBuffer[] srcs, final ByteBuffer[] dsts) throws SSLException | |
| unwrap | back to summary |
|---|---|
| pack-priv abstract SSLEngineResult unwrap(final ByteBuffer[] srcs, int srcsOffset, final int srcsLength, final ByteBuffer[] dsts, final int dstsOffset, final int dstsLength) throws SSLException | |
| wrap | back to summary |
|---|---|
| public abstract SSLEngineResult wrap(ByteBuffer src, ByteBuffer dst) throws SSLException Overrides javax. Doc from javax. Attempts to encode a buffer of plaintext application data into SSL/TLS/DTLS network data. An invocation of this method behaves in exactly the same manner as the invocation:
| |
| wrap | back to summary |
|---|---|
| public abstract SSLEngineResult wrap(ByteBuffer[] srcs, int srcsOffset, int srcsLength, ByteBuffer dst) throws SSLException Implements abstract javax. Doc from javax. Attempts to encode plaintext bytes from a subsequence of data
buffers into SSL/TLS/DTLS network data. This "gathering"
operation encodes, in a single invocation, a sequence of bytes
from one or more of a given sequence of buffers. Gathering
wraps are often useful when implementing network protocols or
file formats that, for example, group data into segments
consisting of one or more fixed-length headers followed by a
variable-length body. See
Depending on the state of the SSLEngine, this method may produce network data without consuming any application data (for example, it may generate handshake data.) The application is responsible for reliably transporting the network data to the peer, and for ensuring that data created by multiple calls to wrap() is transported in the same order in which it was generated. The application must properly synchronize multiple calls to this method.
If this
This method will attempt to produce SSL/TLS/DTLS records, and will
consume as much source data as possible, but will never consume
more than the sum of the bytes remaining in each buffer. Each
The underlying memory used by the See the class description for more information on engine closure.
| |