public class ExportControlled
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ExportControlled.X509TrustManagerWrapper
Implementation of X509TrustManager wrapping JVM X509TrustManagers to add expiration and identity check
|
| 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) |
static javax.net.ssl.SSLContext |
getSSLContext(com.mysql.cj.protocol.ExportControlled.KeyStoreConf clientCertificateKeyStore,
com.mysql.cj.protocol.ExportControlled.KeyStoreConf trustCertificateKeyStore,
boolean fallbackToDefaultTrustStore,
boolean verifyServerCert,
java.lang.String hostName,
ExceptionInterceptor exceptionInterceptor)
Configure the
SSLContext based on the supplier property set. |
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) |
public static boolean enabled()
public static void checkValidProtocols(java.util.List<java.lang.String> protocols)
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(com.mysql.cj.protocol.ExportControlled.KeyStoreConf clientCertificateKeyStore,
com.mysql.cj.protocol.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