public final class SSLExplorer extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
RECORD_HEADER_SIZE
The header size of TLS/SSL records.
|
| Modifier and Type | Method and Description |
|---|---|
static SSLCapabilities |
explore(byte[] source,
int offset,
int length)
Launch and explore the security capabilities from byte array.
|
static SSLCapabilities |
explore(ByteBuffer source)
Launch and explore the security capabilities from byte buffer.
|
static int |
getRequiredSize(byte[] source,
int offset,
int length)
Returns the required number of bytes in the
source byte array
necessary to explore SSL/TLS connection. |
static int |
getRequiredSize(ByteBuffer source)
Returns the required number of bytes in the
source
ByteBuffer necessary to explore SSL/TLS connection. |
public static final int RECORD_HEADER_SIZE
The value of this constant is 5.
public static final int getRequiredSize(ByteBuffer source)
source
ByteBuffer necessary to explore SSL/TLS connection.
This method tries to parse as few bytes as possible from
source byte buffer to get the length of an
SSL/TLS record.
This method accesses the source parameter in read-only
mode, and does not update the buffer's properties such as capacity,
limit, position, and mark values.
source - a ByteBuffer containing
inbound or outbound network data for an SSL/TLS connection.BufferUnderflowException - if less than RECORD_HEADER_SIZE
bytes remaining in sourcepublic static final int getRequiredSize(byte[] source,
int offset,
int length)
throws IOException
source byte array
necessary to explore SSL/TLS connection.
This method tries to parse as few bytes as possible from
source byte array to get the length of an
SSL/TLS record.
source - a byte array containing inbound or outbound network data for
an SSL/TLS connection.offset - the start offset in array source at which the
network data is read from.length - the maximum number of bytes to read.BufferUnderflowException - if less than RECORD_HEADER_SIZE
bytes remaining in sourceIOExceptionpublic static final SSLCapabilities explore(ByteBuffer source) throws IOException
This method tries to parse as few records as possible from
source byte buffer to get the SSLCapabilities
of an SSL/TLS connection.
Please NOTE that this method must be called before any handshaking occurs. The behavior of this method is not defined in this release if the handshake has begun, or has completed.
This method accesses the source parameter in read-only
mode, and does not update the buffer's properties such as capacity,
limit, position, and mark values.
source - a ByteBuffer containing
inbound or outbound network data for an SSL/TLS connection.SSLCapabilities of the SSL/TLS
connectionIOException - on network data errorBufferUnderflowException - if not enough source bytes available
to make a complete exploration.public static final SSLCapabilities explore(byte[] source, int offset, int length) throws IOException
Please NOTE that this method must be called before any handshaking occurs. The behavior of this method is not defined in this release if the handshake has begun, or has completed. Once handshake has begun, or has completed, the security capabilities can not and should not be launched with this method.
source - a byte array containing inbound or outbound network data for
an SSL/TLS connection.offset - the start offset in array source at which the
network data is read from.length - the maximum number of bytes to read.SSLCapabilities of the SSL/TLS
connectionIOException - on network data errorBufferUnderflowException - if not enough source bytes available
to make a complete exploration.explore(ByteBuffer)Copyright © 2021. All Rights Reserved.