org.jboss.security.ssl
Class DomainSocketFactory
java.lang.Object
javax.net.SocketFactory
javax.net.ssl.SSLSocketFactory
org.jboss.security.ssl.DomainSocketFactory
- All Implemented Interfaces:
- EventListener, HandshakeCompletedListener
public class DomainSocketFactory
- extends SSLSocketFactory
- implements HandshakeCompletedListener
An implementation of SocketFactory that creates SSL sockets using the
JSSE SSLContext and a JBossSX SecurityDomain for the KeyManagerFactory
and TrustManagerFactory objects.
- Version:
- $Revision: 1.5.4.3 $
- Author:
- Scott.Stark@jboss.org, Francisco Reverbel
- See Also:
SSLContext
,
SecurityDomain
Constructor Summary |
DomainSocketFactory()
A default constructor for use when created by Class.newInstance. |
DomainSocketFactory(org.jboss.security.SecurityDomain securityDomain)
Create a socket factory instance that uses the given SecurityDomain
as the source for the SSL KeyManagerFactory and TrustManagerFactory. |
Method Summary |
Socket |
createSocket(InetAddress serverAddr,
int serverPort)
|
Socket |
createSocket(InetAddress serverAddr,
int serverPort,
InetAddress clientAddr,
int clientPort)
|
Socket |
createSocket(Socket s,
String host,
int port,
boolean autoClose)
|
Socket |
createSocket(String serverHost,
int serverPort)
Create a client socket connected to the specified host and port. |
Socket |
createSocket(String serverHost,
int serverPort,
InetAddress clientAddr,
int clientPort)
|
static SocketFactory |
getDefault()
The default SocketFactory which looks to the java:/jaas/other
security domain configuration. |
String[] |
getDefaultCipherSuites()
|
org.jboss.security.SecurityDomain |
getSecurityDomain()
|
String[] |
getSupportedCipherSuites()
|
void |
handshakeCompleted(HandshakeCompletedEvent event)
|
boolean |
isNeedsClientAuth()
|
boolean |
isWantsClientAuth()
|
void |
setNeedsClientAuth(boolean needsClientAuth)
|
void |
setSecurityDomain(org.jboss.security.SecurityDomain securityDomain)
|
void |
setWantsClientAuth(boolean wantsClientAuth)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HANDSHAKE_COMPLETE_LISTENER
public static final String HANDSHAKE_COMPLETE_LISTENER
- See Also:
- Constant Field Values
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(org.jboss.security.SecurityDomain securityDomain)
throws IOException
- Create a socket factory instance that uses the given SecurityDomain
as the source for the SSL KeyManagerFactory and TrustManagerFactory.
- Throws:
IOException
getSecurityDomain
public org.jboss.security.SecurityDomain getSecurityDomain()
setSecurityDomain
public void setSecurityDomain(org.jboss.security.SecurityDomain securityDomain)
isWantsClientAuth
public boolean isWantsClientAuth()
setWantsClientAuth
public void setWantsClientAuth(boolean wantsClientAuth)
isNeedsClientAuth
public boolean isNeedsClientAuth()
setNeedsClientAuth
public void setNeedsClientAuth(boolean needsClientAuth)
createSocket
public Socket createSocket(String serverHost,
int serverPort)
throws IOException,
UnknownHostException
- Create a client socket connected to the specified host and port.
- Specified by:
createSocket
in class SocketFactory
- Parameters:
serverHost
- - the host nameserverPort
- - the port number
- Returns:
- a socket connected to the specified host and port.
- Throws:
IOException
- if an I/O error occurs during socket creation.
UnknownHostException
createSocket
public Socket createSocket(String serverHost,
int serverPort,
InetAddress clientAddr,
int clientPort)
throws IOException,
UnknownHostException
- Specified by:
createSocket
in class SocketFactory
- Throws:
IOException
UnknownHostException
createSocket
public Socket createSocket(InetAddress serverAddr,
int serverPort)
throws IOException
- Specified by:
createSocket
in class SocketFactory
- Throws:
IOException
createSocket
public Socket createSocket(InetAddress serverAddr,
int serverPort,
InetAddress clientAddr,
int clientPort)
throws IOException
- Specified by:
createSocket
in class SocketFactory
- Throws:
IOException
createSocket
public Socket createSocket(Socket s,
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
getDefault
public static SocketFactory getDefault()
- The default SocketFactory which looks to the java:/jaas/other
security domain configuration.
handshakeCompleted
public void handshakeCompleted(HandshakeCompletedEvent event)
- Specified by:
handshakeCompleted
in interface HandshakeCompletedListener
Copyright © 2002 JBoss Group, LLC. All Rights Reserved.