mx4j.tools.adaptor.ssl
Class SSLAdaptorServerSocketFactory
java.lang.Object
mx4j.tools.adaptor.ssl.SSLAdaptorServerSocketFactory
- AdaptorServerSocketFactory, SSLAdaptorServerSocketFactoryMBean
public class SSLAdaptorServerSocketFactory
extends java.lang.Object
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
createServerSocket(int,int,String)
is called.
static void | addProvider(Provider provider)
|
ServerSocket | createServerSocket(int port, int backlog, String host) - Returns a SSLServerSocket on the given port.
|
void | setKeyManagerAlgorithm(String algorithm) - Sets the key manager algorithm, by default is "SunX509".
|
void | setKeyManagerPassword(String password) - Sets the password to access the key present in the keystore.
|
void | setKeyStoreName(String name) - Sets the name of the keystore; if the keystore is of type JKS, then this is a file name, that will be
resolved by the ClassLoader of this class, via getResourceAsStream.
|
void | setKeyStorePassword(String password) - Sets the password to access the keystore specified by
SSLAdaptorServerSocketFactoryMBean.setKeyStoreName(String) .
|
void | setKeyStoreType(String keyStoreType) - Sets the type of the keystore, by default is "JKS".
|
void | setSSLProtocol(String protocol) - Sets the SSL protocol version, by default is "TLS".
|
void | setTrustManagerAlgorithm(String algorithm) - Sets the trust manager algorithm, by default is "SunX509".
|
void | setTrustStoreName(String name) - Sets the name of the truststore; if the truststore is of type JKS, then this is a file name, that will be
resolved by the ClassLoader of this class, via getResourceAsStream.
|
void | setTrustStorePassword(String password) - Sets the password to access the truststore specified by
SSLAdaptorServerSocketFactoryMBean.setTrustStoreName(String) .
|
void | setTrustStoreType(String trustStoreType) - Sets the type of the truststore, by default is "JKS".
|
addProvider
public static void addProvider(Provider provider)
setKeyManagerPassword
public void setKeyManagerPassword(String password)
Sets the password to access the key present in the keystore.
It correspond to the value of the -keypass option of keytool; if not specified, the KeyStore password is taken.
- setKeyManagerPassword in interface SSLAdaptorServerSocketFactoryMBean
setKeyStoreName
public void setKeyStoreName(String name)
Sets the name of the keystore; if the keystore is of type JKS, then this is a file name, that will be
resolved by the ClassLoader of this class, via getResourceAsStream.
- setKeyStoreName in interface SSLAdaptorServerSocketFactoryMBean
setTrustStoreName
public void setTrustStoreName(String name)
Sets the name of the truststore; if the truststore is of type JKS, then this is a file name, that will be
resolved by the ClassLoader of this class, via getResourceAsStream.
- setTrustStoreName in interface SSLAdaptorServerSocketFactoryMBean
Copyright © 2001-2005 The MX4J Contributors. All Rights Reserved.