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.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(java.lang.String clientCertificateKeyStoreUrl,
java.lang.String clientCertificateKeyStoreType,
java.lang.String clientCertificateKeyStorePassword,
java.lang.String trustCertificateKeyStoreUrl,
java.lang.String trustCertificateKeyStoreType,
java.lang.String trustCertificateKeyStorePassword,
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)
Converts the socket being used in the given CoreIO to an SSLSocket by
performing the SSL/TLS handshake.
|
static java.nio.channels.AsynchronousSocketChannel |
startTlsOnAsynchronousChannel(java.nio.channels.AsynchronousSocketChannel channel,
SocketConnection socketConnection) |
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) throws java.io.IOException, SSLParamsException, FeatureNotAvailableException
rawSocket
- original non-SSL socketsocketConnection
- the Protocol instance containing the socket to convert to an
SSLSocket.serverVersion
- ServerVersion objectjava.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(java.lang.String clientCertificateKeyStoreUrl, java.lang.String clientCertificateKeyStoreType, java.lang.String clientCertificateKeyStorePassword, java.lang.String trustCertificateKeyStoreUrl, java.lang.String trustCertificateKeyStoreType, java.lang.String trustCertificateKeyStorePassword, boolean fallbackToDefaultTrustStore, boolean verifyServerCert, java.lang.String hostName, ExceptionInterceptor exceptionInterceptor) throws SSLParamsException
SSLContext
based on the supplier property set.clientCertificateKeyStoreUrl
- clientCertificateKeyStoreUrlclientCertificateKeyStoreType
- clientCertificateKeyStoreTypeclientCertificateKeyStorePassword
- clientCertificateKeyStorePasswordtrustCertificateKeyStoreUrl
- trustCertificateKeyStoreUrltrustCertificateKeyStoreType
- trustCertificateKeyStoreTypetrustCertificateKeyStorePassword
- trustCertificateKeyStorePasswordfallbackToDefaultTrustStore
- 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
RSAException
public static byte[] encryptWithRSAPublicKey(byte[] source, java.security.interfaces.RSAPublicKey key, java.lang.String transformation) throws RSAException
RSAException
public static byte[] encryptWithRSAPublicKey(byte[] source, java.security.interfaces.RSAPublicKey key) throws RSAException
RSAException
public static java.nio.channels.AsynchronousSocketChannel startTlsOnAsynchronousChannel(java.nio.channels.AsynchronousSocketChannel channel, SocketConnection socketConnection) throws javax.net.ssl.SSLException
javax.net.ssl.SSLException