org.ofbiz.base.util
Class SSLUtil

java.lang.Object
  extended by org.ofbiz.base.util.SSLUtil

public class SSLUtil
extends java.lang.Object

KeyStoreUtil - Utilities for setting up SSL connections with specific client certificates


Field Summary
static int HOSTCERT_MIN_CHECK
           
static int HOSTCERT_NO_CHECK
           
static int HOSTCERT_NORMAL_CHECK
           
static java.lang.String module
           
 
Constructor Summary
SSLUtil()
           
 
Method Summary
static javax.net.ssl.HostnameVerifier getHostnameVerifier(int level)
           
static javax.net.ssl.KeyManager[] getKeyManagers()
           
static javax.net.ssl.KeyManager[] getKeyManagers(java.security.KeyStore ks, java.lang.String password, java.lang.String alias)
           
static javax.net.ssl.KeyManager[] getKeyManagers(java.lang.String alias)
           
static javax.net.ssl.SSLServerSocketFactory getSSLServerSocketFactory(java.security.KeyStore ks, java.lang.String password, java.lang.String alias)
           
static javax.net.ssl.SSLServerSocketFactory getSSLServerSocketFactory(java.lang.String alias)
           
static javax.net.ssl.SSLSocketFactory getSSLSocketFactory()
           
static javax.net.ssl.SSLSocketFactory getSSLSocketFactory(java.security.KeyStore ks, java.lang.String password, java.lang.String alias)
           
static javax.net.ssl.SSLSocketFactory getSSLSocketFactory(java.lang.String alias)
           
static javax.net.ssl.SSLSocketFactory getSSLSocketFactory(java.lang.String alias, boolean trustAny)
           
static javax.net.ssl.TrustManager[] getTrustAnyManagers()
           
static javax.net.ssl.TrustManager[] getTrustManagers()
           
static javax.net.ssl.TrustManager[] getTrustManagers(java.security.KeyStore ks)
           
static boolean isClientTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType)
           
static void loadJsseProperties()
           
static void loadJsseProperties(boolean debug)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

module

public static final java.lang.String module

HOSTCERT_NO_CHECK

public static final int HOSTCERT_NO_CHECK
See Also:
Constant Field Values

HOSTCERT_MIN_CHECK

public static final int HOSTCERT_MIN_CHECK
See Also:
Constant Field Values

HOSTCERT_NORMAL_CHECK

public static final int HOSTCERT_NORMAL_CHECK
See Also:
Constant Field Values
Constructor Detail

SSLUtil

public SSLUtil()
Method Detail

isClientTrusted

public static boolean isClientTrusted(java.security.cert.X509Certificate[] chain,
                                      java.lang.String authType)

getKeyManagers

public static javax.net.ssl.KeyManager[] getKeyManagers(java.lang.String alias)
                                                 throws java.io.IOException,
                                                        java.security.GeneralSecurityException,
                                                        GenericConfigException
Throws:
java.io.IOException
java.security.GeneralSecurityException
GenericConfigException

getKeyManagers

public static javax.net.ssl.KeyManager[] getKeyManagers()
                                                 throws java.io.IOException,
                                                        java.security.GeneralSecurityException,
                                                        GenericConfigException
Throws:
java.io.IOException
java.security.GeneralSecurityException
GenericConfigException

getTrustManagers

public static javax.net.ssl.TrustManager[] getTrustManagers()
                                                     throws java.io.IOException,
                                                            java.security.GeneralSecurityException,
                                                            GenericConfigException
Throws:
java.io.IOException
java.security.GeneralSecurityException
GenericConfigException

getTrustAnyManagers

public static javax.net.ssl.TrustManager[] getTrustAnyManagers()

getKeyManagers

public static javax.net.ssl.KeyManager[] getKeyManagers(java.security.KeyStore ks,
                                                        java.lang.String password,
                                                        java.lang.String alias)
                                                 throws java.security.GeneralSecurityException
Throws:
java.security.GeneralSecurityException

getTrustManagers

public static javax.net.ssl.TrustManager[] getTrustManagers(java.security.KeyStore ks)
                                                     throws java.security.GeneralSecurityException
Throws:
java.security.GeneralSecurityException

getSSLSocketFactory

public static javax.net.ssl.SSLSocketFactory getSSLSocketFactory(java.security.KeyStore ks,
                                                                 java.lang.String password,
                                                                 java.lang.String alias)
                                                          throws java.io.IOException,
                                                                 java.security.GeneralSecurityException,
                                                                 GenericConfigException
Throws:
java.io.IOException
java.security.GeneralSecurityException
GenericConfigException

getSSLSocketFactory

public static javax.net.ssl.SSLSocketFactory getSSLSocketFactory(java.lang.String alias,
                                                                 boolean trustAny)
                                                          throws java.io.IOException,
                                                                 java.security.GeneralSecurityException,
                                                                 GenericConfigException
Throws:
java.io.IOException
java.security.GeneralSecurityException
GenericConfigException

getSSLSocketFactory

public static javax.net.ssl.SSLSocketFactory getSSLSocketFactory(java.lang.String alias)
                                                          throws java.io.IOException,
                                                                 java.security.GeneralSecurityException,
                                                                 GenericConfigException
Throws:
java.io.IOException
java.security.GeneralSecurityException
GenericConfigException

getSSLSocketFactory

public static javax.net.ssl.SSLSocketFactory getSSLSocketFactory()
                                                          throws java.io.IOException,
                                                                 java.security.GeneralSecurityException,
                                                                 GenericConfigException
Throws:
java.io.IOException
java.security.GeneralSecurityException
GenericConfigException

getSSLServerSocketFactory

public static javax.net.ssl.SSLServerSocketFactory getSSLServerSocketFactory(java.security.KeyStore ks,
                                                                             java.lang.String password,
                                                                             java.lang.String alias)
                                                                      throws java.io.IOException,
                                                                             java.security.GeneralSecurityException,
                                                                             GenericConfigException
Throws:
java.io.IOException
java.security.GeneralSecurityException
GenericConfigException

getSSLServerSocketFactory

public static javax.net.ssl.SSLServerSocketFactory getSSLServerSocketFactory(java.lang.String alias)
                                                                      throws java.io.IOException,
                                                                             java.security.GeneralSecurityException,
                                                                             GenericConfigException
Throws:
java.io.IOException
java.security.GeneralSecurityException
GenericConfigException

getHostnameVerifier

public static javax.net.ssl.HostnameVerifier getHostnameVerifier(int level)

loadJsseProperties

public static void loadJsseProperties()

loadJsseProperties

public static void loadJsseProperties(boolean debug)