|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mx4j.tools.adaptor.ssl.SSLAdaptorServerSocketFactory
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.
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 365or with this minimal command (that will prompt you for further information):
keytool -genkey -keystore store.keyA 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:
setKeyStoreName(java.lang.String)
("store.key");
setKeyStorePassword(java.lang.String)
("storepwd");
setKeyManagerPassword(java.lang.String)
("keypwd");
createServerSocket(int, int, java.lang.String)
is called.
Constructor Summary | |
SSLAdaptorServerSocketFactory()
|
Method Summary | |
static void |
addProvider(java.security.Provider provider)
|
java.net.ServerSocket |
createServerSocket(int port,
int backlog,
java.lang.String host)
Returns a SSLServerSocket on the given port. |
void |
setKeyManagerAlgorithm(java.lang.String algorithm)
Sets the key manager algorithm, by default is "SunX509". |
void |
setKeyManagerPassword(java.lang.String password)
Sets the password to access the key present in the keystore. |
void |
setKeyStoreName(java.lang.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(java.lang.String password)
Sets the password to access the keystore specified by setKeyStoreName(java.lang.String) . |
void |
setKeyStoreType(java.lang.String keyStoreType)
Sets the type of the keystore, by default is "JKS". |
void |
setSSLProtocol(java.lang.String protocol)
Sets the SSL protocol version, by default is "TLS". |
void |
setTrustManagerAlgorithm(java.lang.String algorithm)
Sets the trust manager algorithm, by default is "SunX509". |
void |
setTrustStoreName(java.lang.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(java.lang.String password)
Sets the password to access the truststore specified by setTrustStoreName(java.lang.String) . |
void |
setTrustStoreType(java.lang.String trustStoreType)
Sets the type of the truststore, by default is "JKS". |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SSLAdaptorServerSocketFactory()
Method Detail |
public static void addProvider(java.security.Provider provider)
public void setKeyStoreType(java.lang.String keyStoreType)
SSLAdaptorServerSocketFactoryMBean
setKeyStoreType
in interface SSLAdaptorServerSocketFactoryMBean
public void setTrustStoreType(java.lang.String trustStoreType)
SSLAdaptorServerSocketFactoryMBean
setTrustStoreType
in interface SSLAdaptorServerSocketFactoryMBean
public void setKeyStoreName(java.lang.String name)
SSLAdaptorServerSocketFactoryMBean
setKeyStoreName
in interface SSLAdaptorServerSocketFactoryMBean
public void setTrustStoreName(java.lang.String name)
SSLAdaptorServerSocketFactoryMBean
setTrustStoreName
in interface SSLAdaptorServerSocketFactoryMBean
public void setKeyStorePassword(java.lang.String password)
SSLAdaptorServerSocketFactoryMBean
SSLAdaptorServerSocketFactoryMBean.setKeyStoreName(java.lang.String)
. It correspond to the value of the -storepass option of keytool.
setKeyStorePassword
in interface SSLAdaptorServerSocketFactoryMBean
public void setTrustStorePassword(java.lang.String password)
SSLAdaptorServerSocketFactoryMBean
SSLAdaptorServerSocketFactoryMBean.setTrustStoreName(java.lang.String)
. It correspond to the value of the -storepass option of keytool.
setTrustStorePassword
in interface SSLAdaptorServerSocketFactoryMBean
public void setKeyManagerAlgorithm(java.lang.String algorithm)
SSLAdaptorServerSocketFactoryMBean
setKeyManagerAlgorithm
in interface SSLAdaptorServerSocketFactoryMBean
public void setTrustManagerAlgorithm(java.lang.String algorithm)
SSLAdaptorServerSocketFactoryMBean
setTrustManagerAlgorithm
in interface SSLAdaptorServerSocketFactoryMBean
public void setKeyManagerPassword(java.lang.String password)
SSLAdaptorServerSocketFactoryMBean
It correspond to the value of the -keypass option of keytool; if not specified, the KeyStore password is taken.
setKeyManagerPassword
in interface SSLAdaptorServerSocketFactoryMBean
public void setSSLProtocol(java.lang.String protocol)
SSLAdaptorServerSocketFactoryMBean
setSSLProtocol
in interface SSLAdaptorServerSocketFactoryMBean
public java.net.ServerSocket createServerSocket(int port, int backlog, java.lang.String host) throws java.io.IOException
createServerSocket
in interface AdaptorServerSocketFactory
java.io.IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |