类 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 RSAPublicKeydecodeRSAPublicKey(String key)static booleanenabled()static byte[]encryptWithRSAPublicKey(byte[] source, RSAPublicKey key)static byte[]encryptWithRSAPublicKey(byte[] source, RSAPublicKey key, String transformation)static SSLContextgetSSLContext(String clientCertificateKeyStoreUrl, String clientCertificateKeyStoreType, String clientCertificateKeyStorePassword, String trustCertificateKeyStoreUrl, String trustCertificateKeyStoreType, String trustCertificateKeyStorePassword, 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)Converts the socket being used in the given CoreIO to an SSLSocket by performing the SSL/TLS handshake.static AsynchronousSocketChannelstartTlsOnAsynchronousChannel(AsynchronousSocketChannel channel, SocketConnection socketConnection)
-
-
-
方法详细资料
-
enabled
public static boolean enabled()
-
performTlsHandshake
public static Socket performTlsHandshake(Socket rawSocket, SocketConnection socketConnection, ServerVersion serverVersion) throws IOException, SSLParamsException, FeatureNotAvailableException
Converts the socket being used in the given CoreIO 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 object- 返回:
- 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(String clientCertificateKeyStoreUrl, String clientCertificateKeyStoreType, String clientCertificateKeyStorePassword, String trustCertificateKeyStoreUrl, String trustCertificateKeyStoreType, String trustCertificateKeyStorePassword, boolean fallbackToDefaultTrustStore, boolean verifyServerCert, String hostName, ExceptionInterceptor exceptionInterceptor) throws SSLParamsException
Configure theSSLContextbased on the supplier property set.- 参数:
clientCertificateKeyStoreUrl- clientCertificateKeyStoreUrlclientCertificateKeyStoreType- clientCertificateKeyStoreTypeclientCertificateKeyStorePassword- clientCertificateKeyStorePasswordtrustCertificateKeyStoreUrl- trustCertificateKeyStoreUrltrustCertificateKeyStoreType- trustCertificateKeyStoreTypetrustCertificateKeyStorePassword- trustCertificateKeyStorePasswordfallbackToDefaultTrustStore- 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
-
startTlsOnAsynchronousChannel
public static AsynchronousSocketChannel startTlsOnAsynchronousChannel(AsynchronousSocketChannel channel, SocketConnection socketConnection) throws SSLException
- 抛出:
SSLException
-
-