com.ca.commons.security.ssl
Class CustomSSLSocketFactory

java.lang.Object
  extended by javax.net.SocketFactory
      extended by javax.net.ssl.SSLSocketFactory
          extended by com.ca.commons.security.ssl.CustomSSLSocketFactory
Direct Known Subclasses:
CustomNoTrustCheckSSLSocketFactory

public class CustomSSLSocketFactory
extends SSLSocketFactory


Field Summary
static Logger logger
           
 
Constructor Summary
protected CustomSSLSocketFactory(SSLSocketFactory factory)
           
 
Method Summary
 Socket createSocket()
           
 Socket createSocket(InetAddress host, int port)
           
 Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort)
           
 Socket createSocket(Socket socket, String host, int port, boolean autoClose)
           
 Socket createSocket(String host, int port)
           
 Socket createSocket(String host, int port, InetAddress localHost, int localPort)
           
static SocketFactory getDefault()
           
 String[] getDefaultCipherSuites()
           
 String[] getDefaultProtocols()
           
 String[] getSupportedCipherSuites()
           
static String[] getSupportedProtocols()
           
static void initCAKeyStore(InputStream in, String type, char[] pwd)
           
static void initClientCertKeyStore(InputStream in, String type, char[] pwd)
           
static void setTraceCerts(boolean traceCerts)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static final Logger logger
Constructor Detail

CustomSSLSocketFactory

protected CustomSSLSocketFactory(SSLSocketFactory factory)
Method Detail

initCAKeyStore

public static void initCAKeyStore(InputStream in,
                                  String type,
                                  char[] pwd)
                           throws GeneralSecurityException,
                                  IOException
Throws:
GeneralSecurityException
IOException

initClientCertKeyStore

public static void initClientCertKeyStore(InputStream in,
                                          String type,
                                          char[] pwd)
                                   throws GeneralSecurityException,
                                          IOException
Throws:
GeneralSecurityException
IOException

getDefault

public static SocketFactory getDefault()

createSocket

public Socket createSocket()
                    throws IOException
Overrides:
createSocket in class SocketFactory
Throws:
IOException

createSocket

public Socket createSocket(String host,
                           int port)
                    throws IOException
Specified by:
createSocket in class SocketFactory
Throws:
IOException

createSocket

public Socket createSocket(String host,
                           int port,
                           InetAddress localHost,
                           int localPort)
                    throws IOException
Specified by:
createSocket in class SocketFactory
Throws:
IOException

createSocket

public Socket createSocket(InetAddress host,
                           int port)
                    throws IOException
Specified by:
createSocket in class SocketFactory
Throws:
IOException

createSocket

public Socket createSocket(InetAddress address,
                           int port,
                           InetAddress localAddress,
                           int localPort)
                    throws IOException
Specified by:
createSocket in class SocketFactory
Throws:
IOException

createSocket

public Socket createSocket(Socket socket,
                           String host,
                           int port,
                           boolean autoClose)
                    throws IOException
Specified by:
createSocket in class SSLSocketFactory
Throws:
IOException

getDefaultCipherSuites

public String[] getDefaultCipherSuites()
Specified by:
getDefaultCipherSuites in class SSLSocketFactory

getSupportedCipherSuites

public String[] getSupportedCipherSuites()
Specified by:
getSupportedCipherSuites in class SSLSocketFactory

getDefaultProtocols

public String[] getDefaultProtocols()

getSupportedProtocols

public static String[] getSupportedProtocols()

setTraceCerts

public static void setTraceCerts(boolean traceCerts)


Created 2011-07-14 13:27 EST