org.openorb.orb.ssl
Class SSLContextFinder

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.openorb.orb.ssl.SSLContextFinder
All Implemented Interfaces:
org.apache.avalon.framework.logger.LogEnabled
Direct Known Subclasses:
JSSEContextFinder

public abstract class SSLContextFinder
extends org.apache.avalon.framework.logger.AbstractLogEnabled

Creates SSL contexts that conform to Sun's javax.net interfaces. This class is extended by JSSEContextFinder, a placeholder for JSSE-specific access. In most applications there will only be a single instance of this class, this differs from most other orb parts in which there is one per VM... This must be overloaded by an application to provide extended functionality beyond a JSSE-specific implementation. Overloading classes are encouraged to use identical property keys.

Author:
Chris Wood, Sean Parker

Field Summary
protected  javax.net.ServerSocketFactory m_server_socket_factory
          The server socket factory instance.
protected  javax.net.SocketFactory m_socket_factory
          The socket factory instance.
protected static SSLContextFinder s_instance
          The VM wide SSLContextFinder instance.
 
Constructor Summary
SSLContextFinder()
          This constructor is followed by a call to setFactories, can be used when sublclassing the context.
 
Method Summary
static SSLContextFinder getDefault(org.omg.PortableInterceptor.ORBInitInfo orbinfo, org.openorb.orb.pi.FeatureInitInfo featureinfo)
          Get the default context finder.
static SSLContextFinder getDefault(org.omg.PortableInterceptor.ORBInitInfo orbinfo, org.openorb.orb.pi.FeatureInitInfo featureinfo, org.apache.avalon.framework.logger.Logger logger)
          Get the default context finder.
protected abstract  com.sun.net.ssl.KeyManager[] getKeyManagers(org.openorb.orb.config.ORBLoader loader)
          Load the key managers.
 javax.net.ServerSocketFactory getServerSocketFactory()
          Returns the configured server socket factory.
 javax.net.SocketFactory getSocketFactory()
          Returns the configured socket factory.
protected abstract  com.sun.net.ssl.TrustManager[] getTrustManagers(org.openorb.orb.config.ORBLoader loader)
          Load trust managers.
 void initialize(org.openorb.orb.config.ORBLoader loader)
          Default construction from properties.
protected  java.net.URL promptKeystore(java.lang.String owner, java.net.URL defl, org.omg.CORBA.CharSeqHolder csh)
          Prompt for a keystore and password.
protected  char[] promptPassword(java.lang.String owner, java.net.URL defl)
          Prompt for a password for the specified keystore.
protected  void setFactories(javax.net.ServerSocketFactory svrSocketFactory, javax.net.SocketFactory socketFactory)
          This method should be used by subclasses to set the socket factories.
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

s_instance

protected static SSLContextFinder s_instance
The VM wide SSLContextFinder instance.


m_server_socket_factory

protected javax.net.ServerSocketFactory m_server_socket_factory
The server socket factory instance.


m_socket_factory

protected javax.net.SocketFactory m_socket_factory
The socket factory instance.

Constructor Detail

SSLContextFinder

public SSLContextFinder()
This constructor is followed by a call to setFactories, can be used when sublclassing the context.

Method Detail

initialize

public void initialize(org.openorb.orb.config.ORBLoader loader)
Default construction from properties. Subclasses should implement a constructor with an identical signature.

Parameters:
loader - The ORB loader.

getDefault

public static SSLContextFinder getDefault(org.omg.PortableInterceptor.ORBInitInfo orbinfo,
                                          org.openorb.orb.pi.FeatureInitInfo featureinfo)
Get the default context finder.

Parameters:
orbinfo - The ORB init info.
featureinfo - The OpenORB features.
Returns:
An instance of the SSLContextfinder class.

getDefault

public static SSLContextFinder getDefault(org.omg.PortableInterceptor.ORBInitInfo orbinfo,
                                          org.openorb.orb.pi.FeatureInitInfo featureinfo,
                                          org.apache.avalon.framework.logger.Logger logger)
Get the default context finder.

Parameters:
orbinfo - The ORB init info.
featureinfo - The OpenORB features.
logger - A logger instance.
Returns:
An instance of the SSLContextfinder class.

getKeyManagers

protected abstract com.sun.net.ssl.KeyManager[] getKeyManagers(org.openorb.orb.config.ORBLoader loader)
Load the key managers. Subclasses may overload to provide an alternate key manager loading mechanism.

Parameters:
loader - The ORB loader.
Returns:
An array of key managers.

getTrustManagers

protected abstract com.sun.net.ssl.TrustManager[] getTrustManagers(org.openorb.orb.config.ORBLoader loader)
Load trust managers. Subclasses may overload to provide an alternate trust manager loading mechanism.

Parameters:
loader - The ORB loader.
Returns:
An array of TrusManagers.

promptKeystore

protected java.net.URL promptKeystore(java.lang.String owner,
                                      java.net.URL defl,
                                      org.omg.CORBA.CharSeqHolder csh)
Prompt for a keystore and password.

Parameters:
owner - keystore owner. This will be "key manager" or "trust manager"
defl - default URL obtained from properties.
csh - out paramater, contains password on return.
Returns:
Keystore URL.

promptPassword

protected char[] promptPassword(java.lang.String owner,
                                java.net.URL defl)
Prompt for a password for the specified keystore.

Parameters:
owner - keystore owner. This will be "key manager" or "trust manager"
defl - URL obtained from properties of the keystore.
Returns:
Keystore password.

setFactories

protected void setFactories(javax.net.ServerSocketFactory svrSocketFactory,
                            javax.net.SocketFactory socketFactory)
This method should be used by subclasses to set the socket factories.

Parameters:
svrSocketFactory - The server socket factory.
socketFactory - The socket factory.

getServerSocketFactory

public javax.net.ServerSocketFactory getServerSocketFactory()
Returns the configured server socket factory.

Returns:
The server socket factory.

getSocketFactory

public javax.net.SocketFactory getSocketFactory()
Returns the configured socket factory.

Returns:
The socket factory.