mx4j.tools.adaptor.ssl

Class SSLAdaptorServerSocketFactory

public class SSLAdaptorServerSocketFactory extends Object implements SSLAdaptorServerSocketFactoryMBean

TODO: Fix this class to avoid hardcoding Sun's provider, since it will not work with IBM's JDK. This MBean creates SSLServerSocket instances.

It can be configured to use a specific keystore and SSL protocol version to create SSLServerSockets that will use the keystore information to encrypt data.

A keystore can be created with this command:

 keytool -genkey -v -keystore store.key -storepass storepwd -keypass keypwd -dname "CN=Simone Bordet, OU=Project Administrator, O=MX4J, L=Torino, S=TO, C=IT" -validity 365
 
or with this minimal command (that will prompt you for further information):
 keytool -genkey -keystore store.key
 

A keystore may contains more than one entry, but only the first entry will be used for encryption, no matter which is the alias for that entry.

Following the first example of generation of the keystore, this MBean must be instantiated and then setup by invoking the following methods:

before SSLAdaptorServerSocketFactory is called.

Version: $Revision: 1.5 $

Method Summary
static voidaddProvider(Provider provider)
ServerSocketcreateServerSocket(int port, int backlog, String host)
Returns a SSLServerSocket on the given port.
voidsetKeyManagerAlgorithm(String algorithm)
voidsetKeyManagerPassword(String password)
voidsetKeyStoreName(String name)
voidsetKeyStorePassword(String password)
voidsetKeyStoreType(String keyStoreType)
voidsetSSLProtocol(String protocol)
voidsetTrustManagerAlgorithm(String algorithm)
voidsetTrustStoreName(String name)
voidsetTrustStorePassword(String password)
voidsetTrustStoreType(String trustStoreType)

Method Detail

addProvider

public static void addProvider(Provider provider)

createServerSocket

public ServerSocket createServerSocket(int port, int backlog, String host)
Returns a SSLServerSocket on the given port.

setKeyManagerAlgorithm

public void setKeyManagerAlgorithm(String algorithm)

setKeyManagerPassword

public void setKeyManagerPassword(String password)

setKeyStoreName

public void setKeyStoreName(String name)

setKeyStorePassword

public void setKeyStorePassword(String password)

setKeyStoreType

public void setKeyStoreType(String keyStoreType)

setSSLProtocol

public void setSSLProtocol(String protocol)

setTrustManagerAlgorithm

public void setTrustManagerAlgorithm(String algorithm)

setTrustStoreName

public void setTrustStoreName(String name)

setTrustStorePassword

public void setTrustStorePassword(String password)

setTrustStoreType

public void setTrustStoreType(String trustStoreType)
Copyright © 2001-2005 The MX4J Contributors. All Rights Reserved.