org.openorb.orb.ssl
Class JSSEContextFinder

java.lang.Object
  extended by AbstractLogEnabled
      extended by org.openorb.orb.ssl.SSLContextFinder
          extended by org.openorb.orb.ssl.JSSEContextFinder
Direct Known Subclasses:
RSAContextFinder

public class JSSEContextFinder
extends SSLContextFinder

Creates JSSE-specific SSL contexts. 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 can be overloaded by an application to provide extended functionality if required. Overloading classes are encouraged to use identical property keys.

Author:
Sean Parker

Field Summary
 
Fields inherited from class org.openorb.orb.ssl.SSLContextFinder
m_server_socket_factory, m_socket_factory, s_instance
 
Constructor Summary
JSSEContextFinder()
          This constructor, is followed by a call to setFactories, can be used when sublclassing the context.
 
Method Summary
protected  com.sun.net.ssl.KeyManager[] getKeyManagers(ORBLoader loader)
          Load the key managers.
protected  com.sun.net.ssl.TrustManager[] getTrustManagers(ORBLoader loader)
          Load trust managers.
 void initialize(ORBLoader loader)
          Default construction from properties.
protected  void initializeSocketFactories(ORBLoader loader)
          Initialize socket factories.
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.
 
Methods inherited from class org.openorb.orb.ssl.SSLContextFinder
getDefault, getDefault, getServerSocketFactory, getSocketFactory, setFactories
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSSEContextFinder

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

Method Detail

initialize

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

Overrides:
initialize in class SSLContextFinder
Parameters:
loader - The ORB loader.
Throws:
org.omg.CORBA.INITIALIZE - Indicates a problem locating JSSE-related resources required by configuration.

initializeSocketFactories

protected void initializeSocketFactories(ORBLoader loader)
Initialize socket factories.

Parameters:
loader - The ORB loader.

getKeyManagers

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

Specified by:
getKeyManagers in class SSLContextFinder
Parameters:
loader - The ORB loader.
Returns:
An array of key managers.
Throws:
org.omg.CORBA.INITIALIZE - Indicates a problem locating JSSE-related resources required by configuration.

getTrustManagers

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

Specified by:
getTrustManagers in class SSLContextFinder
Parameters:
loader - The ORB loader.
Returns:
An array of TrusManagers.
Throws:
org.omg.CORBA.INITIALIZE - Indicates a problem locating JSSE-related resources required by configuration.

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.

Overrides:
promptKeystore in class SSLContextFinder
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.

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