This is a public class to allow testing to occur on Android via CTS.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | SSLUtils.EngineStates
States for SSL engines. |
| pack-priv static enum |
| Modifier and Type | Field and Description |
|---|---|
| private static final String | KEY_TYPE_EC
Key type: Elliptic Curve certificate. |
| private static final String | KEY_TYPE_RSA
Key type: RSA certificate. |
| private static final int | |
| private static final int | MAX_ENCRYPTION_OVERHEAD_LENGTH
This is the maximum overhead when encrypting plaintext as defined by rfc5264, rfc5289, and the BoringSSL implementation itself. |
| private static final int | |
| private static final Charset | |
| pack-priv static final boolean |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static int | calculateOutNetBufSize(int pendingBytes)
Calculates the minimum bytes required in the encrypted output buffer for the given number of plaintext source bytes. |
| pack-priv static String[] | |
| pack-priv static String[] | decodeProtocols(byte[]
the encoded protocol list protocols)Decodes the given list of protocols into |
| private static X509Certificate | |
| pack-priv static X509Certificate[] | |
| pack-priv static byte[] | Returns: the encoded form of the protocol list.the list of protocols to be encoded protocols)Encodes a list of protocols into the wire-format (length-prefixed 8-bit strings). |
| pack-priv static byte[][] | |
| private static CertificateFactory | |
| pack-priv static String | getClientKeyType(byte clientCertificateType)
Similar to getServerKeyType, but returns value given TLS ClientCertificateType byte values from a CertificateRequest message for use with X509KeyManager.chooseClientAlias or X509ExtendedKeyManager.chooseEngineClientAlias. |
| pack-priv static String | |
| pack-priv static int | Returns: length The length of the encrypted packet that is included in the buffer. This will return-1 if the given ByteBuffer is not encrypted at all.The buffers, int offset)ByteBuffers to read from. Be aware that they must have at least
org. bytes to read, otherwise it will
throw an IllegalArgumentException.Return how much bytes can be read out of the encrypted data. |
| private static int | |
| pack-priv static String | getServerX509KeyType(long sslCipherNative)
Returns key type constant suitable for calling X509KeyManager.chooseServerAlias or X509ExtendedKeyManager.chooseEngineServerAlias. |
| pack-priv static Set | Returns: supported key types that can be used inX509KeyManager.chooseClientAlias and
X509ExtendedKeyManager.chooseEngineClientAlias. If the inputs imply a preference
order, the returned set will have an iteration order that respects that preference order,
otherwise it will be in an arbitrary order.
Visible for testing.ClientCertificateType values provided by the server.
See https://www.ietf.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-2.SignatureScheme values provided by the server.
See https://www.ietf.org/assignments/tls-parameters/tls-parameters.xml#tls-signatureschemeGets the supported key types for client certificates based on the
|
| pack-priv static X509Certificate[] | toCertificateChain(X509Certificate[] certificates)
Deprecated
as a consequence of
Converts the peer certificates into a cert chain.
X509Certificate being deprecated.
|
| pack-priv static byte[] | |
| pack-priv static String | |
| pack-priv static SSLException | |
| pack-priv static SSLHandshakeException | toSSLHandshakeException(Throwable e)
Wraps the given exception if it's not already a |
| private static short | |
| private static int |
| KEY_TYPE_EC | back to summary |
|---|---|
| private static final String KEY_TYPE_EC Key type: Elliptic Curve certificate. | |
| KEY_TYPE_RSA | back to summary |
|---|---|
| private static final String KEY_TYPE_RSA Key type: RSA certificate. | |
| MAX_ENCRYPTION_OVERHEAD_DIFF | back to summary |
|---|---|
| private static final int MAX_ENCRYPTION_OVERHEAD_DIFF | |
| MAX_ENCRYPTION_OVERHEAD_LENGTH | back to summary |
|---|---|
| private static final int MAX_ENCRYPTION_OVERHEAD_LENGTH This is the maximum overhead when encrypting plaintext as defined by rfc5264, rfc5289, and the BoringSSL implementation itself. Please note that we use a padding of 16 here as BoringSSL uses PKCS#5 which uses 16 bytes while the spec itself allow up to 255 bytes. 16 bytes is the max for PKCS#5 (which handles it the same way as PKCS#7) as we use a block size of 16. See rfc5652#section-6.3. 16 (IV) + 48 (MAC) + 1 (Padding_length field) + 15 (Padding) + 1 (ContentType in TLSCiphertext) + 2 (ProtocolVersion) + 2 (Length) + 1 (ContentType in TLSInnerPlaintext) | |
| MAX_PROTOCOL_LENGTH | back to summary |
|---|---|
| private static final int MAX_PROTOCOL_LENGTH | |
| US_ASCII | back to summary |
|---|---|
| private static final Charset US_ASCII | |
| USE_ENGINE_SOCKET_BY_DEFAULT | back to summary |
|---|---|
| pack-priv static final boolean USE_ENGINE_SOCKET_BY_DEFAULT | |
| SSLUtils | back to summary |
|---|---|
| private SSLUtils() | |
| calculateOutNetBufSize | back to summary |
|---|---|
| pack-priv static int calculateOutNetBufSize(int pendingBytes) Calculates the minimum bytes required in the encrypted output buffer for the given number of plaintext source bytes. | |
| concat | back to summary |
|---|---|
| pack-priv static String[] concat(String[]... arrays) | |
| decodeProtocols | back to summary |
|---|---|
| pack-priv static String[] decodeProtocols(byte[] protocols) Decodes the given list of protocols into
| |
| decodeX509Certificate | back to summary |
|---|---|
| private static X509Certificate decodeX509Certificate(CertificateFactory certificateFactory, byte[] bytes) throws CertificateException | |
| decodeX509CertificateChain | back to summary |
|---|---|
| pack-priv static X509Certificate[] decodeX509CertificateChain(byte[][] certChain) throws CertificateException | |
| encodeProtocols | back to summary |
|---|---|
| pack-priv static byte[] encodeProtocols(String[] protocols) Encodes a list of protocols into the wire-format (length-prefixed 8-bit strings). Requires that all strings be encoded with US-ASCII.
| |
| encodeSubjectX509Principals | back to summary |
|---|---|
| pack-priv static byte[][] encodeSubjectX509Principals(X509Certificate[] certificates) throws CertificateEncodingException | |
| getCertificateFactory | back to summary |
|---|---|
| private static CertificateFactory getCertificateFactory() | |
| getClientKeyType | back to summary |
|---|---|
| pack-priv static String getClientKeyType(byte clientCertificateType) Similar to getServerKeyType, but returns value given TLS ClientCertificateType byte values from a CertificateRequest message for use with X509KeyManager.chooseClientAlias or X509ExtendedKeyManager.chooseEngineClientAlias. Visible for testing. | |
| getClientKeyTypeFromSignatureAlg | back to summary |
|---|---|
| pack-priv static String getClientKeyTypeFromSignatureAlg(int signatureAlg) | |
| getEncryptedPacketLength | back to summary |
|---|---|
| pack-priv static int getEncryptedPacketLength(ByteBuffer[] buffers, int offset) Return how much bytes can be read out of the encrypted data. Be aware that this method will
not increase the readerIndex of the given
| |
| getEncryptedPacketLength | back to summary |
|---|---|
| private static int getEncryptedPacketLength(ByteBuffer buffer) | |
| getServerX509KeyType | back to summary |
|---|---|
| pack-priv static String getServerX509KeyType(long sslCipherNative) Returns key type constant suitable for calling X509KeyManager.chooseServerAlias or
X509ExtendedKeyManager.chooseEngineServerAlias. Returns | |
| getSupportedClientKeyTypes | back to summary |
|---|---|
| pack-priv static Set Gets the supported key types for client certificates based on the
| |
| toCertificateChain | back to summary |
|---|---|
| pack-priv static X509Certificate[] toCertificateChain(X509Certificate[] certificates) throws SSLPeerUnverifiedException
Deprecated as a consequence of Converts the peer certificates into a cert chain. | |
| toProtocolBytes | back to summary |
|---|---|
| pack-priv static byte[] toProtocolBytes(String protocol) | |
| toProtocolString | back to summary |
|---|---|
| pack-priv static String toProtocolString(byte[] bytes) | |
| toSSLException | back to summary |
|---|---|
| pack-priv static SSLException toSSLException(Throwable e) Wraps the given exception if it's not already a | |
| toSSLHandshakeException | back to summary |
|---|---|
| pack-priv static SSLHandshakeException toSSLHandshakeException(Throwable e) Wraps the given exception if it's not already a | |
| unsignedByte | back to summary |
|---|---|
| private static short unsignedByte(byte b) | |
| unsignedShort | back to summary |
|---|---|
| private static int unsignedShort(short s) | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final int | STATE_CLOSED
The engine has been closed. |
| pack-priv static final int | STATE_CLOSED_INBOUND
The inbound direction of the engine has been closed. |
| pack-priv static final int | STATE_CLOSED_OUTBOUND
The outbound direction of the engine has been closed. |
| pack-priv static final int | STATE_HANDSHAKE_COMPLETED
Listeners of the handshake have been notified of completion but the handshake call hasn't returned. |
| pack-priv static final int | STATE_HANDSHAKE_STARTED
The handshake has been started |
| pack-priv static final int | STATE_MODE_SET
The client/server mode of the engine has been set. |
| pack-priv static final int | STATE_NEW
The engine is constructed, but the initial handshake hasn't been started |
| pack-priv static final int | STATE_READY
The handshake call has returned and the listeners have been notified. |
| pack-priv static final int | STATE_READY_HANDSHAKE_CUT_THROUGH
The handshake call returned but the listeners have not yet been notified. |
| Access | Constructor and Description |
|---|---|
| private |
| STATE_CLOSED | back to summary |
|---|---|
| pack-priv static final int STATE_CLOSED The engine has been closed. | |
| STATE_CLOSED_INBOUND | back to summary |
|---|---|
| pack-priv static final int STATE_CLOSED_INBOUND The inbound direction of the engine has been closed. | |
| STATE_CLOSED_OUTBOUND | back to summary |
|---|---|
| pack-priv static final int STATE_CLOSED_OUTBOUND The outbound direction of the engine has been closed. | |
| STATE_HANDSHAKE_COMPLETED | back to summary |
|---|---|
| pack-priv static final int STATE_HANDSHAKE_COMPLETED Listeners of the handshake have been notified of completion but the handshake call hasn't returned. | |
| STATE_HANDSHAKE_STARTED | back to summary |
|---|---|
| pack-priv static final int STATE_HANDSHAKE_STARTED The handshake has been started | |
| STATE_MODE_SET | back to summary |
|---|---|
| pack-priv static final int STATE_MODE_SET The client/server mode of the engine has been set. | |
| STATE_NEW | back to summary |
|---|---|
| pack-priv static final int STATE_NEW The engine is constructed, but the initial handshake hasn't been started | |
| STATE_READY | back to summary |
|---|---|
| pack-priv static final int STATE_READY The handshake call has returned and the listeners have been notified. Ready to begin writing data. | |
| STATE_READY_HANDSHAKE_CUT_THROUGH | back to summary |
|---|---|
| pack-priv static final int STATE_READY_HANDSHAKE_CUT_THROUGH The handshake call returned but the listeners have not yet been notified. This is expected behaviour in cut-through mode, where SSL_do_handshake returns before the handshake is complete. We can now start writing data to the socket. | |
| EngineStates | back to summary |
|---|---|
| private EngineStates() | |
| Modifier and Type | Field and Description |
|---|---|
| public static final SSLUtils. | OPEN_SSL
Identifies OpenSSL sessions. |
| public static final SSLUtils. | OPEN_SSL_WITH_OCSP
Identifies OpenSSL sessions with OCSP stapled data. |
| public static final SSLUtils. | OPEN_SSL_WITH_TLS_SCT
Identifies OpenSSL sessions with TLS SCT data. |
| pack-priv final int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static boolean | |
| public static SSLUtils. | |
| public static SSLUtils. |
| OPEN_SSL | back to summary |
|---|---|
| public static final SSLUtils. Identifies OpenSSL sessions. | |
| OPEN_SSL_WITH_OCSP | back to summary |
|---|---|
| public static final SSLUtils. Identifies OpenSSL sessions with OCSP stapled data. | |
| OPEN_SSL_WITH_TLS_SCT | back to summary |
|---|---|
| public static final SSLUtils. Identifies OpenSSL sessions with TLS SCT data. | |
| value | back to summary |
|---|---|
| pack-priv final int value | |
| SessionType | back to summary |
|---|---|
| private SessionType(int value) | |
| isSupportedType | back to summary |
|---|---|
| pack-priv static boolean isSupportedType(int type) | |
| valueOf | back to summary |
|---|---|
| public static SSLUtils. | |
| values | back to summary |
|---|---|
| public static SSLUtils. | |