public class ExportControlled
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
private static class |
ExportControlled.KeyStoreConf |
static class |
ExportControlled.X509TrustManagerWrapper
Implementation of X509TrustManager wrapping JVM X509TrustManagers to add expiration and identity check
|
| Modifier and Type | Field and Description |
|---|---|
private static java.util.List<java.lang.String> |
ALLOWED_CIPHERS |
private static java.lang.String[] |
KNOWN_TLS_PROTOCOLS |
private static java.util.List<java.lang.String> |
RESTRICTED_CIPHER_SUBSTR |
private static java.lang.String |
TLS_SETTINGS_RESOURCE |
private static java.lang.String |
TLSv1 |
private static java.lang.String |
TLSv1_1 |
private static java.lang.String |
TLSv1_2 |
private static java.lang.String |
TLSv1_3 |
private static java.lang.String[] |
VALID_TLS_PROTOCOLS |
| Modifier | Constructor and Description |
|---|---|
private |
ExportControlled() |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkValidProtocols(java.util.List<java.lang.String> protocols) |
static java.security.interfaces.RSAPrivateKey |
decodeRSAPrivateKey(java.lang.String key) |
static java.security.interfaces.RSAPublicKey |
decodeRSAPublicKey(java.lang.String key) |
static boolean |
enabled() |
static byte[] |
encryptWithRSAPublicKey(byte[] source,
java.security.interfaces.RSAPublicKey key) |
static byte[] |
encryptWithRSAPublicKey(byte[] source,
java.security.interfaces.RSAPublicKey key,
java.lang.String transformation) |
private static java.lang.String[] |
getAllowedCiphers(PropertySet pset,
java.util.List<java.lang.String> socketCipherSuites) |
private static java.lang.String[] |
getAllowedProtocols(PropertySet pset,
ServerVersion serverVersion,
java.lang.String[] socketProtocols) |
private static ExportControlled.KeyStoreConf |
getKeyStoreConf(PropertySet propertySet) |
static javax.net.ssl.SSLContext |
getSSLContext(ExportControlled.KeyStoreConf clientCertificateKeyStore,
ExportControlled.KeyStoreConf trustCertificateKeyStore,
boolean fallbackToDefaultTrustStore,
boolean verifyServerCert,
java.lang.String hostName,
ExceptionInterceptor exceptionInterceptor)
Configure the
SSLContext based on the supplier property set. |
private static ExportControlled.KeyStoreConf |
getTrustStoreConf(PropertySet propertySet,
boolean required) |
private static java.util.List<java.lang.String> |
getValidProtocols(java.lang.String[] protocols) |
static boolean |
isSSLEstablished(java.net.Socket socket) |
static java.net.Socket |
performTlsHandshake(java.net.Socket rawSocket,
SocketConnection socketConnection,
ServerVersion serverVersion,
Log log)
Converts the socket being used in the given SocketConnection to an SSLSocket by performing the SSL/TLS handshake.
|
static byte[] |
sign(byte[] source,
java.security.interfaces.RSAPrivateKey privateKey) |
private static final java.lang.String TLSv1
private static final java.lang.String TLSv1_1
private static final java.lang.String TLSv1_2
private static final java.lang.String TLSv1_3
private static final java.lang.String[] KNOWN_TLS_PROTOCOLS
private static final java.lang.String[] VALID_TLS_PROTOCOLS
private static final java.lang.String TLS_SETTINGS_RESOURCE
private static final java.util.List<java.lang.String> ALLOWED_CIPHERS
private static final java.util.List<java.lang.String> RESTRICTED_CIPHER_SUBSTR
public static boolean enabled()
private static java.lang.String[] getAllowedCiphers(PropertySet pset, java.util.List<java.lang.String> socketCipherSuites)
private static java.lang.String[] getAllowedProtocols(PropertySet pset, ServerVersion serverVersion, java.lang.String[] socketProtocols)
private static java.util.List<java.lang.String> getValidProtocols(java.lang.String[] protocols)
public static void checkValidProtocols(java.util.List<java.lang.String> protocols)
private static ExportControlled.KeyStoreConf getTrustStoreConf(PropertySet propertySet, boolean required)
private static ExportControlled.KeyStoreConf getKeyStoreConf(PropertySet propertySet)
public static java.net.Socket performTlsHandshake(java.net.Socket rawSocket,
SocketConnection socketConnection,
ServerVersion serverVersion,
Log log)
throws java.io.IOException,
SSLParamsException,
FeatureNotAvailableException
rawSocket - original non-SSL socketsocketConnection - the Protocol instance containing the socket to convert to an SSLSocket.serverVersion - ServerVersion objectlog - Loggerjava.io.IOException - if i/o exception occursSSLParamsException - if the handshake fails, or if this distribution of Connector/J doesn't contain the SSL crypto hooks needed to perform the handshake.FeatureNotAvailableException - if TLS is not supportedpublic static javax.net.ssl.SSLContext getSSLContext(ExportControlled.KeyStoreConf clientCertificateKeyStore, ExportControlled.KeyStoreConf trustCertificateKeyStore, boolean fallbackToDefaultTrustStore, boolean verifyServerCert, java.lang.String hostName, ExceptionInterceptor exceptionInterceptor) throws SSLParamsException
SSLContext based on the supplier property set.clientCertificateKeyStore - clientCertificateKeyStoretrustCertificateKeyStore - trustCertificateKeyStorefallbackToDefaultTrustStore - fallbackToDefaultTrustStoreverifyServerCert - verifyServerCerthostName - host nameexceptionInterceptor - exception interceptorSSLParamsException - if an error occurspublic static boolean isSSLEstablished(java.net.Socket socket)
public static java.security.interfaces.RSAPublicKey decodeRSAPublicKey(java.lang.String key)
throws RSAException
RSAExceptionpublic static byte[] encryptWithRSAPublicKey(byte[] source,
java.security.interfaces.RSAPublicKey key,
java.lang.String transformation)
throws RSAException
RSAExceptionpublic static byte[] encryptWithRSAPublicKey(byte[] source,
java.security.interfaces.RSAPublicKey key)
throws RSAException
RSAExceptionpublic static java.security.interfaces.RSAPrivateKey decodeRSAPrivateKey(java.lang.String key)
throws RSAException
RSAExceptionpublic static byte[] sign(byte[] source,
java.security.interfaces.RSAPrivateKey privateKey)
throws RSAException
RSAException