类 ExportControlled
- java.lang.Object
-
- com.mysql.cj.protocol.ExportControlled
-
public class ExportControlled extends Object
Holds functionality that falls under export-control regulations.
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classExportControlled.X509TrustManagerWrapperImplementation of X509TrustManager wrapping JVM X509TrustManagers to add expiration and identity check
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static voidcheckValidProtocols(List<String> protocols)static RSAPrivateKeydecodeRSAPrivateKey(String key)static RSAPublicKeydecodeRSAPublicKey(String key)static booleanenabled()static byte[]encryptWithRSAPublicKey(byte[] source, RSAPublicKey key)static byte[]encryptWithRSAPublicKey(byte[] source, RSAPublicKey key, String transformation)static SSLContextgetSSLContext(com.mysql.cj.protocol.ExportControlled.KeyStoreConf clientCertificateKeyStore, com.mysql.cj.protocol.ExportControlled.KeyStoreConf trustCertificateKeyStore, boolean fallbackToDefaultTrustStore, boolean verifyServerCert, String hostName, ExceptionInterceptor exceptionInterceptor)Configure theSSLContextbased on the supplier property set.static booleanisSSLEstablished(Socket socket)static SocketperformTlsHandshake(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, RSAPrivateKey privateKey)
-
-
-
方法详细资料
-
enabled
public static boolean enabled()
-
performTlsHandshake
public static Socket performTlsHandshake(Socket rawSocket, SocketConnection socketConnection, ServerVersion serverVersion, Log log) throws IOException, SSLParamsException, FeatureNotAvailableException
Converts the socket being used in the given SocketConnection to an SSLSocket by performing the SSL/TLS handshake.- 参数:
rawSocket- original non-SSL socketsocketConnection- the Protocol instance containing the socket to convert to an SSLSocket.serverVersion- ServerVersion objectlog- Logger- 返回:
- SSL socket
- 抛出:
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 supported
-
getSSLContext
public static SSLContext getSSLContext(com.mysql.cj.protocol.ExportControlled.KeyStoreConf clientCertificateKeyStore, com.mysql.cj.protocol.ExportControlled.KeyStoreConf trustCertificateKeyStore, boolean fallbackToDefaultTrustStore, boolean verifyServerCert, String hostName, ExceptionInterceptor exceptionInterceptor) throws SSLParamsException
Configure theSSLContextbased on the supplier property set.- 参数:
clientCertificateKeyStore- clientCertificateKeyStoretrustCertificateKeyStore- trustCertificateKeyStorefallbackToDefaultTrustStore- fallbackToDefaultTrustStoreverifyServerCert- verifyServerCerthostName- host nameexceptionInterceptor- exception interceptor- 返回:
- SSLContext
- 抛出:
SSLParamsException- if an error occurs
-
isSSLEstablished
public static boolean isSSLEstablished(Socket socket)
-
decodeRSAPublicKey
public static RSAPublicKey decodeRSAPublicKey(String key) throws RSAException
- 抛出:
RSAException
-
encryptWithRSAPublicKey
public static byte[] encryptWithRSAPublicKey(byte[] source, RSAPublicKey key, String transformation) throws RSAException- 抛出:
RSAException
-
encryptWithRSAPublicKey
public static byte[] encryptWithRSAPublicKey(byte[] source, RSAPublicKey key) throws RSAException- 抛出:
RSAException
-
decodeRSAPrivateKey
public static RSAPrivateKey decodeRSAPrivateKey(String key) throws RSAException
- 抛出:
RSAException
-
sign
public static byte[] sign(byte[] source, RSAPrivateKey privateKey) throws RSAException- 抛出:
RSAException
-
-