Class SSLExplorer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe header size of TLS/SSL records. -
Method Summary
Modifier and TypeMethodDescriptionstatic final SSLCapabilitiesexplore(byte[] source, int offset, int length) Launch and explore the security capabilities from byte array.static final SSLCapabilitiesexplore(ByteBuffer source) Launch and explore the security capabilities from byte buffer.static final intgetRequiredSize(byte[] source, int offset, int length) Returns the required number of bytes in thesourcebyte array necessary to explore SSL/TLS connection.static final intgetRequiredSize(ByteBuffer source) Returns the required number of bytes in thesourceByteBuffernecessary to explore SSL/TLS connection.
-
Field Details
-
RECORD_HEADER_SIZE
public static final int RECORD_HEADER_SIZEThe header size of TLS/SSL records.The value of this constant is 5.
- See Also:
-
-
Method Details
-
getRequiredSize
Returns the required number of bytes in thesourceByteBuffernecessary to explore SSL/TLS connection.This method tries to parse as few bytes as possible from
sourcebyte buffer to get the length of an SSL/TLS record.This method accesses the
sourceparameter in read-only mode, and does not update the buffer's properties such as capacity, limit, position, and mark values.- Parameters:
source- aByteBuffercontaining inbound or outbound network data for an SSL/TLS connection.- Returns:
- the required size in byte to explore an SSL/TLS connection
- Throws:
BufferUnderflowException- if less thanRECORD_HEADER_SIZEbytes remaining insource
-
getRequiredSize
Returns the required number of bytes in thesourcebyte array necessary to explore SSL/TLS connection.This method tries to parse as few bytes as possible from
sourcebyte array to get the length of an SSL/TLS record.- Parameters:
source- a byte array containing inbound or outbound network data for an SSL/TLS connection.offset- the start offset in arraysourceat which the network data is read from.length- the maximum number of bytes to read.- Returns:
- the required size in byte to explore an SSL/TLS connection
- Throws:
BufferUnderflowException- if less thanRECORD_HEADER_SIZEbytes remaining insourceIOException
-
explore
Launch and explore the security capabilities from byte buffer.This method tries to parse as few records as possible from
sourcebyte buffer to get theSSLCapabilitiesof 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
sourceparameter in read-only mode, and does not update the buffer's properties such as capacity, limit, position, and mark values.- Parameters:
source- aByteBuffercontaining inbound or outbound network data for an SSL/TLS connection.- Returns:
- the explored
SSLCapabilitiesof the SSL/TLS connection - Throws:
IOException- on network data errorBufferUnderflowException- if not enough source bytes available to make a complete exploration.
-
explore
public static final SSLCapabilities explore(byte[] source, int offset, int length) throws IOException Launch and explore the security capabilities from byte array.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.
- Parameters:
source- a byte array containing inbound or outbound network data for an SSL/TLS connection.offset- the start offset in arraysourceat which the network data is read from.length- the maximum number of bytes to read.- Returns:
- the explored
SSLCapabilitiesof the SSL/TLS connection - Throws:
IOException- on network data errorBufferUnderflowException- if not enough source bytes available to make a complete exploration.- See Also:
-