org.jboss.net.ssl
Class JBossSocketFactory

java.lang.Object
  extended byJSSE14SocketFactory
      extended byorg.jboss.net.ssl.JBossSocketFactory

public class JBossSocketFactory
extends JSSE14SocketFactory

Extends the tomcat JSSE14SocketFactory to obtain the server key and trust stores from the SecurityDomain defined by the securityDomain attribute of the connector.

See Also:
Serialized Form

Constructor Summary
JBossSocketFactory()
           
 
Method Summary
protected  javax.net.ssl.KeyManager[] getKeyManagers(java.lang.String keystoreType, java.lang.String algorithm, java.lang.String keyAlias)
          Override to obtain the KeyManagers from the security domain.
protected  java.security.KeyStore getKeystore(java.lang.String type, java.lang.String pass)
          Gets the SSL server's keystore from the SecurityDomain.
protected  javax.net.ssl.TrustManager[] getTrustManagers(java.lang.String keystoreType, java.lang.String algorithm)
          Override to obtain the TrustManagers from the security domain.
protected  java.security.KeyStore getTrustStore(java.lang.String type)
           
 void setAttribute(java.lang.String name, java.lang.Object value)
           
 void setSecurityDomainName(java.lang.String jndiName)
          Set the SecurityDomain to use for the key/trust stores
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JBossSocketFactory

public JBossSocketFactory()
Method Detail

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)

setSecurityDomainName

public void setSecurityDomainName(java.lang.String jndiName)
                           throws javax.naming.NamingException,
                                  java.io.IOException
Set the SecurityDomain to use for the key/trust stores

Parameters:
jndiName - - the jndi name of the SecurityDomain binding
Throws:
javax.naming.NamingException
java.io.IOException

getKeystore

protected java.security.KeyStore getKeystore(java.lang.String type,
                                             java.lang.String pass)
                                      throws java.io.IOException
Gets the SSL server's keystore from the SecurityDomain.

Parameters:
type - - ignored, this comes from the security domain config
pass - - ignore, this comes from the security domain config
Returns:
the KeyStore for the server cert
Throws:
java.io.IOException

getTrustStore

protected java.security.KeyStore getTrustStore(java.lang.String type)
                                        throws java.io.IOException
Throws:
java.io.IOException

getTrustManagers

protected javax.net.ssl.TrustManager[] getTrustManagers(java.lang.String keystoreType,
                                                        java.lang.String algorithm)
                                                 throws java.lang.Exception
Override to obtain the TrustManagers from the security domain.

Parameters:
keystoreType - - ignored, this comes from the security domain
algorithm - - ignored, this comes from the security domain
Returns:
the array of TrustManagers from the security domain
Throws:
java.lang.Exception

getKeyManagers

protected javax.net.ssl.KeyManager[] getKeyManagers(java.lang.String keystoreType,
                                                    java.lang.String algorithm,
                                                    java.lang.String keyAlias)
                                             throws java.lang.Exception
Override to obtain the KeyManagers from the security domain.

Parameters:
keystoreType - - ignored, this comes from the security domain
algorithm - - ignored, this comes from the security domain
keyAlias - - ignored
Returns:
the array of KeyManagers from the security domain
Throws:
java.lang.Exception