org.jboss.security.ssl
Class DomainSocketFactory

java.lang.Object
  extended byjavax.net.SocketFactory
      extended byjavax.net.ssl.SSLSocketFactory
          extended byorg.jboss.security.ssl.DomainSocketFactory
All Implemented Interfaces:
java.util.EventListener, javax.net.ssl.HandshakeCompletedListener

public class DomainSocketFactory
extends javax.net.ssl.SSLSocketFactory
implements javax.net.ssl.HandshakeCompletedListener

An implementation of SocketFactory that creates SSL sockets using the JSSE SSLContext and a JBossSX SecurityDomain for the KeyManagerFactory and TrustManagerFactory objects.

See Also:
SSLContext, SecurityDomain (src)

Constructor Summary
DomainSocketFactory()
          A default constructor for use when created by Class.newInstance.
DomainSocketFactory(SecurityDomain (src)  securityDomain)
          Create a socket factory instance that uses the given SecurityDomain as the source for the SSL KeyManagerFactory and TrustManagerFactory.
 
Method Summary
 java.net.Socket createSocket(java.net.InetAddress serverAddr, int serverPort)
           
 java.net.Socket createSocket(java.net.InetAddress serverAddr, int serverPort, java.net.InetAddress clientAddr, int clientPort)
           
 java.net.Socket createSocket(java.net.Socket s, java.lang.String host, int port, boolean autoClose)
           
 java.net.Socket createSocket(java.lang.String serverHost, int serverPort)
          Create a client socket connected to the specified host and port.
 java.net.Socket createSocket(java.lang.String serverHost, int serverPort, java.net.InetAddress clientAddr, int clientPort)
           
static javax.net.SocketFactory getDefault()
          The default SocketFactory which looks to the java:/jaas/other security domain configuration.
 java.lang.String[] getDefaultCipherSuites()
           
 SecurityDomain (src) getSecurityDomain()
           
 java.lang.String[] getSupportedCipherSuites()
           
 void handshakeCompleted(javax.net.ssl.HandshakeCompletedEvent handshakeCompletedEvent)
           
 boolean isNeedsClientAuth()
           
 boolean isWantsClientAuth()
           
 void setNeedsClientAuth(boolean needsClientAuth)
           
 void setSecurityDomain(SecurityDomain (src)  securityDomain)
           
 void setWantsClientAuth(boolean wantsClientAuth)
           
 
Methods inherited from class javax.net.SocketFactory
createSocket
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DomainSocketFactory

public DomainSocketFactory()
A default constructor for use when created by Class.newInstance. The factory is not usable until its SecurityDomain has been established.


DomainSocketFactory

public DomainSocketFactory(SecurityDomain (src)  securityDomain)
                    throws java.io.IOException
Create a socket factory instance that uses the given SecurityDomain as the source for the SSL KeyManagerFactory and TrustManagerFactory.

Method Detail

getSecurityDomain

public SecurityDomain (src)  getSecurityDomain()

setSecurityDomain

public void setSecurityDomain(SecurityDomain (src)  securityDomain)

isWantsClientAuth

public boolean isWantsClientAuth()

setWantsClientAuth

public void setWantsClientAuth(boolean wantsClientAuth)

isNeedsClientAuth

public boolean isNeedsClientAuth()

setNeedsClientAuth

public void setNeedsClientAuth(boolean needsClientAuth)

createSocket

public java.net.Socket createSocket(java.lang.String serverHost,
                                    int serverPort)
                             throws java.io.IOException,
                                    java.net.UnknownHostException
Create a client socket connected to the specified host and port.

Parameters:
serverHost - - the host name
serverPort - - the port number
Returns:
a socket connected to the specified host and port.
Throws:
java.io.IOException - if an I/O error occurs during socket creation.
java.net.UnknownHostException

createSocket

public java.net.Socket createSocket(java.lang.String serverHost,
                                    int serverPort,
                                    java.net.InetAddress clientAddr,
                                    int clientPort)
                             throws java.io.IOException,
                                    java.net.UnknownHostException
Throws:
java.io.IOException
java.net.UnknownHostException

createSocket

public java.net.Socket createSocket(java.net.InetAddress serverAddr,
                                    int serverPort)
                             throws java.io.IOException
Throws:
java.io.IOException

createSocket

public java.net.Socket createSocket(java.net.InetAddress serverAddr,
                                    int serverPort,
                                    java.net.InetAddress clientAddr,
                                    int clientPort)
                             throws java.io.IOException
Throws:
java.io.IOException

createSocket

public java.net.Socket createSocket(java.net.Socket s,
                                    java.lang.String host,
                                    int port,
                                    boolean autoClose)
                             throws java.io.IOException
Throws:
java.io.IOException

getDefaultCipherSuites

public java.lang.String[] getDefaultCipherSuites()

getSupportedCipherSuites

public java.lang.String[] getSupportedCipherSuites()

getDefault

public static javax.net.SocketFactory getDefault()
The default SocketFactory which looks to the java:/jaas/other security domain configuration.


handshakeCompleted

public void handshakeCompleted(javax.net.ssl.HandshakeCompletedEvent handshakeCompletedEvent)
Specified by:
handshakeCompleted in interface javax.net.ssl.HandshakeCompletedListener