|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.remoting.security.SSLSocketBuilder
public class SSLSocketBuilder
A class that contains code that remoting factories need to build customized server and client SSL sockets.
Nested Class Summary | |
---|---|
protected class |
SSLSocketBuilder.NullStoreURLException
Used to indicate a store URL was not specified and thus the store is not available. |
Field Summary | |
---|---|
static java.lang.String |
CLIENT_AUTH_MODE_NEED
Client auth mode that indicates that client authentication is required. |
static java.lang.String |
CLIENT_AUTH_MODE_NONE
Client auth mode that indicates client authentication will not be peformed. |
static java.lang.String |
CLIENT_AUTH_MODE_WANT
Client auth mode that indicates that we want client authentication but it isn't required. |
static java.lang.String |
DEFAULT_KEY_STORE_ALGORITHM
Default key/trust store algorithm if one net set as bean property or via config. |
static java.lang.String |
DEFAULT_KEY_STORE_TYPE
Default key/trust store type if one not set as bean property, via config, or via system property. |
static java.lang.String |
DEFAULT_SSL_PROTOCOL
If the protocol isn't specified, this will be the default. |
static java.lang.String |
REMOTING_CLIENT_AUTH_MODE
Constant defining the config property used to define if sockets need or want client authentication. |
static java.lang.String |
REMOTING_DEFAULT_SOCKET_FACTORY_CLASS
System property key to define the fully qualified class name of default socket factory to use when not using custom config. |
static java.lang.String |
REMOTING_KEY_ALIAS
Constant defining the config property that indicates the client's alias as found in the keystore. |
static java.lang.String |
REMOTING_KEY_PASSWORD
Constant defining the config property that indicates the key password for the keys in the key store. |
static java.lang.String |
REMOTING_KEY_STORE_ALGORITHM
Constant defining the config property that defines the key management algorithm used by the keystore. |
static java.lang.String |
REMOTING_KEY_STORE_FILE_PATH
Constant defining the config property used to define where JBoss/Remoting will look for the keystore file. |
static java.lang.String |
REMOTING_KEY_STORE_PASSWORD
Constant defining the config property that defines the password of the keystore. |
static java.lang.String |
REMOTING_KEY_STORE_TYPE
Constant defining the config property that defines the keystore's type. |
static java.lang.String |
REMOTING_SERVER_AUTH_MODE
Constant defining the config property used to define if a client should attempt to authenticate a server certificate as one it trusts. |
static java.lang.String |
REMOTING_SERVER_SOCKET_USE_CLIENT_MODE
Constant defining the config property used to define if the server sockets will be in client or server mode. |
static java.lang.String |
REMOTING_SOCKET_USE_CLIENT_MODE
Constant defining the config property used to define if the sockets will be in client or server mode. |
static java.lang.String |
REMOTING_SSL_PROTOCOL
Constant defining the config property used to define the SSL socket protocol to use. |
static java.lang.String |
REMOTING_SSL_PROVIDER_NAME
Constant defining the config property used to define the SSL provider to use. |
static java.lang.String |
REMOTING_TRUST_STORE_ALGORITHM
Constant defining the config property that defines the key management algorithm used by the truststore. |
static java.lang.String |
REMOTING_TRUST_STORE_FILE_PATH
Constant defining the config property used to define where JBoss/Remoting will look for the truststore file. |
static java.lang.String |
REMOTING_TRUST_STORE_PASSWORD
Constant defining the config property that defines the password of the keystore. |
static java.lang.String |
REMOTING_TRUST_STORE_TYPE
Constant defining the config property that defines the truststore's type. |
static java.lang.String |
STANDARD_KEY_STORE_FILE_PATH
Constant that defines the standard system property that the javax.net.ssl classes look for when locating the keystore file. |
static java.lang.String |
STANDARD_KEY_STORE_PASSWORD
Constant that defines the standard system property that the javax.net.ssl classes look for when needing the keystore password. |
static java.lang.String |
STANDARD_KEY_STORE_TYPE
Constant that defines the standard system property that the javax.net.ssl classes look for when needing to know what type the keystore file is. |
static java.lang.String |
STANDARD_TRUST_STORE_FILE_PATH
Constant that defines the standard system property that the javax.net.ssl classes look for when locating the truststore file. |
static java.lang.String |
STANDARD_TRUST_STORE_PASSWORD
Constant that defines the standard system property that the javax.net.ssl classes look for when needing the truststore password. |
static java.lang.String |
STANDARD_TRUST_STORE_TYPE
Constant that defines the standard system property that the javax.net.ssl classes look for when needing to know what type the truststore file is. |
Constructor Summary | |
---|---|
SSLSocketBuilder()
Constructor for SSLSocketBuilder that does not have
any configuration so it falls back to all defaults. |
|
SSLSocketBuilder(java.util.Map config)
Constructor for SSLSocketBuilder that allows the caller to
override the default settings for the various SSL configuration
properties. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Creates a clone. |
void |
create()
No-op - just needed for MBean service API. |
protected javax.net.ServerSocketFactory |
createCustomServerSocketFactory(CustomSSLServerSocketFactory wrapper)
This creates a fully custom SSL server socket factory using this object's configuration. |
protected javax.net.SocketFactory |
createCustomSocketFactory(CustomSSLSocketFactory wrapper)
This creates a fully custom SSL socket factory using this object's configuration. |
protected void |
createServerSocketFactorySSLContext()
Creates (but does not initialize) the SSL context used by this object to create server socket factories. |
protected void |
createSocketFactorySSLContext()
Creates (but does not initialize) the SSL context used by this object to create socket factories. |
javax.net.ServerSocketFactory |
createSSLServerSocketFactory()
Will create a SSLServerSocketFactory . |
javax.net.ServerSocketFactory |
createSSLServerSocketFactory(CustomSSLServerSocketFactory wrapper)
Will create a SSLServerSocketFactory . |
javax.net.SocketFactory |
createSSLSocketFactory()
Will create a SSLSocketFactory . |
javax.net.SocketFactory |
createSSLSocketFactory(CustomSSLSocketFactory wrapper)
Will create a SSLSocketFactory . |
void |
destroy()
No-op - just needed for MBean server API. |
java.lang.String |
getClientAuthMode()
Returns the client authentication mode to say if sockets will not require client authentication, will want client auth but not require it or to require it. |
java.lang.String |
getKeyAlias()
Returns the key alias used to identify the client's key in the keystore. |
java.lang.String |
getKeyPassword()
Returns the password to use for the keys within the key store. |
java.net.URL |
getKeyStore()
Returns the path to the key store as a URL. |
java.lang.String |
getKeyStoreAlgorithm()
Returns the algorithm used to manage the keys in the keystore. |
java.lang.String |
getKeyStorePassword()
Returns the password used to gain access to the keystore. |
java.lang.String |
getKeyStoreType()
Returns the keystore's file type. |
java.lang.String |
getKeyStoreURL()
Returns the path to the key store as a String. |
java.security.Provider |
getProvider()
Returns the Cryptographic Service Provider which supplies a concrete implementation of a subset of the Java 2 SDK Security API cryptography features. |
java.lang.String |
getProviderName()
Returns the name of the Cryptographic Service Provider which refers to a package or set of packages that supply a concrete implementation of a subset of the Java 2 SDK Security API cryptography features. |
java.security.SecureRandom |
getSecureRandom()
Returns the secure random used by this object's SSL context. |
java.lang.String |
getSecureSocketProtocol()
Returns the name of the secure socket protocol to be used by the sockets created by our factories. |
javax.net.ssl.SSLContext |
getServerSocketFactorySSLContext()
Returns the SSL context that will create the server socket factories. |
javax.net.ssl.SSLContext |
getSocketFactorySSLContext()
Returns the SSL context that will create the socket factories. |
java.net.URL |
getTrustStore()
Gets the path to the truststore file. |
java.lang.String |
getTrustStoreAlgorithm()
Returns the algorithm used to manage the keys in the truststore. |
java.lang.String |
getTrustStorePassword()
Returns the password used to gain access to the truststore. |
java.lang.String |
getTrustStoreType()
Gets the truststore's file type. |
java.lang.String |
getTrustStoreURL()
Gets the path to the truststore file. |
boolean |
getUseSSLServerSocketFactory()
Return whether SSLServerSocketFactory.getDefault() will be used or not. |
boolean |
getUseSSLSocketFactory()
Return whether SSLSocketFactory.getDefault() will be used or not. |
protected void |
initializeServerSocketFactorySSLContext()
Initializes the SSL context used by this object that will create the server socket factories. |
protected void |
initializeSocketFactorySSLContext()
Initializes the SSL context used by this object that will create the socket factories. |
boolean |
isClientAuthModeNeed()
Determines if there must be client authentication - it is required. |
boolean |
isClientAuthModeNone()
Determines if there should be no client authentication. |
boolean |
isClientAuthModeWant()
Determines if there should be client authentication but it isn't required. |
boolean |
isServerAuthMode()
Returns the server authentication mode to say if a client socket will require to authenticate a server certificate as trustworthy. |
boolean |
isServerSocketUseClientMode()
Returns the flag to indicate if the server sockets created by the factories should be in client mode. |
boolean |
isSocketUseClientMode()
Returns the flag to indicate if the sockets created by the factories should be in client mode. |
protected javax.net.ssl.KeyManager[] |
loadKeyManagers()
Loads the key managers based on this object's truststore. |
protected java.security.KeyStore |
loadKeyStore(java.lang.String storeType,
java.net.URL storePathURL,
java.lang.String storePassword)
Loads a key store file and returns it. |
protected javax.net.ssl.TrustManager[] |
loadTrustManagers(boolean isClientMode)
Loads the trust managers based on this object's truststore. |
void |
setClientAuthMode(java.lang.String mode)
Sets the client authentication mode to say if sockets will not require client authentication, will want client auth but not require it or to require it. |
void |
setKeyAlias(java.lang.String alias)
Sets the key alias used to identify the client's key in the keystore. |
void |
setKeyPassword(java.lang.String keyPassword)
Sets the password to use for the keys within the key store. |
void |
setKeyStore(java.net.URL keyStore)
Sets the path to the keystore file as a URL |
void |
setKeyStoreAlgorithm(java.lang.String algorithm)
Sets the algorithm used to manage the keys in the keystore. |
void |
setKeyStorePassword(java.lang.String keyStorePassword)
Sets the password used to gain access to the keystore. |
void |
setKeyStoreType(java.lang.String keyStoreType)
Sets the keystore's file type. |
void |
setKeyStoreURL(java.lang.String keyStoreFilePath)
Sets the path to the keystore file. |
void |
setProvider(java.security.Provider provider)
Sets the Cryptographic Service Provider which supplies a concrete implementation of a subset of the Java 2 SDK Security API cryptography features. |
void |
setProviderName(java.lang.String providerName)
Sets the name of the Cryptographic Service Provider which refers to a package or set of packages that supply a concrete implementation of a subset of the Java 2 SDK Security API cryptography features. |
void |
setSecureRandom(java.security.SecureRandom secureRandom)
Provides this class with the SecureRandom object to use when initializing the SSL contexts. |
void |
setSecureSocketProtocol(java.lang.String protocol)
Sets the name of the secure socket protocol to be used by the sockets created by our factories. |
void |
setServerAuthMode(boolean mode)
Sets the server authentication mode to say if a client socket will require to authenticate a server certificate as trustworthy. |
void |
setServerSocketUseClientMode(boolean useClientMode)
Sets the flag to indicate if the server sockets created by the factories should be in client mode. |
void |
setSocketUseClientMode(boolean useClientMode)
Sets the flag to indicate if the sockets created by the factories should be in client mode. |
void |
setTrustStore(java.net.URL trustStore)
Sets the path to the truststore file. |
void |
setTrustStoreAlgorithm(java.lang.String algorithm)
Sets the algorithm used to manage the keys in the truststore. |
void |
setTrustStorePassword(java.lang.String trustStorePassword)
Sets the password used to gain access to the truststore. |
void |
setTrustStoreType(java.lang.String trustStoreType)
Sets the truststore's file type. |
void |
setTrustStoreURL(java.lang.String trustStoreFilePath)
Sets the path to the truststore file. |
void |
setUseSSLServerSocketFactory(boolean shouldUse)
Setting the flag that indicates if this class should use SSLServerSocketFactory.getDefault()
when creating the ServerSocketFactory to use (when calling SSLSocketBuilderMBean.createSSLServerSocketFactory() ). |
void |
setUseSSLSocketFactory(boolean shouldUse)
Setting the flag that indicates if this class should use SSLSocketFactory.getDefault() when
creating the SocketFactory to use (when calling SSLSocketBuilderMBean.createSSLSocketFactory() ). |
void |
start()
No-op - just needed for MBean service API. |
void |
stop()
No-op - just needed for MBean server API. |
protected java.net.URL |
validateStoreURL(java.lang.String storePath)
Given a store file path, this will verify that the store actually exists. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String REMOTING_SSL_PROVIDER_NAME
public static final java.lang.String REMOTING_SSL_PROTOCOL
public static final java.lang.String DEFAULT_SSL_PROTOCOL
public static final java.lang.String REMOTING_SOCKET_USE_CLIENT_MODE
public static final java.lang.String REMOTING_SERVER_SOCKET_USE_CLIENT_MODE
public static final java.lang.String REMOTING_CLIENT_AUTH_MODE
public static final java.lang.String CLIENT_AUTH_MODE_NONE
public static final java.lang.String CLIENT_AUTH_MODE_WANT
public static final java.lang.String CLIENT_AUTH_MODE_NEED
public static final java.lang.String REMOTING_SERVER_AUTH_MODE
public static final java.lang.String REMOTING_KEY_STORE_FILE_PATH
public static final java.lang.String REMOTING_KEY_STORE_TYPE
public static final java.lang.String REMOTING_KEY_STORE_ALGORITHM
public static final java.lang.String REMOTING_KEY_STORE_PASSWORD
public static final java.lang.String REMOTING_KEY_ALIAS
public static final java.lang.String REMOTING_KEY_PASSWORD
public static final java.lang.String STANDARD_KEY_STORE_FILE_PATH
public static final java.lang.String STANDARD_KEY_STORE_TYPE
public static final java.lang.String STANDARD_KEY_STORE_PASSWORD
public static final java.lang.String DEFAULT_KEY_STORE_TYPE
public static final java.lang.String DEFAULT_KEY_STORE_ALGORITHM
public static final java.lang.String REMOTING_TRUST_STORE_FILE_PATH
public static final java.lang.String REMOTING_TRUST_STORE_TYPE
public static final java.lang.String REMOTING_TRUST_STORE_ALGORITHM
public static final java.lang.String REMOTING_TRUST_STORE_PASSWORD
public static final java.lang.String STANDARD_TRUST_STORE_FILE_PATH
public static final java.lang.String STANDARD_TRUST_STORE_TYPE
public static final java.lang.String STANDARD_TRUST_STORE_PASSWORD
public static final java.lang.String REMOTING_DEFAULT_SOCKET_FACTORY_CLASS
Constructor Detail |
---|
public SSLSocketBuilder()
SSLSocketBuilder
that does not have
any configuration so it falls back to all defaults.
public SSLSocketBuilder(java.util.Map config)
SSLSocketBuilder
that allows the caller to
override the default settings for the various SSL configuration
properties.
config
- configuration with properties defining things like where the
keystore and truststore files are, their types, etc.Method Detail |
---|
public void setUseSSLServerSocketFactory(boolean shouldUse)
SSLSocketBuilderMBean
SSLServerSocketFactory.getDefault()
when creating the ServerSocketFactory to use (when calling SSLSocketBuilderMBean.createSSLServerSocketFactory()
). If
true
, will allow for setting key store location (via javax.net.ssl.keyStore
system
property) and setting of the key store password (via javax.net.ssl.keyStorePassword
system
property) and no other configuration is needed (none of the other setters will need to be called and are in
fact ignored). If set to false
, will allow the custom setting of secure socket protocol, key
store management algorithm, file location, password among other things.
The default value is true
.
NOTE: If this is not explicitly set to false
, no customizations can be made and the
default implementation provided by the JVM vendor being used will be executed.
setUseSSLServerSocketFactory
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.setUseSSLServerSocketFactory(boolean)
public boolean getUseSSLServerSocketFactory()
SSLSocketBuilderMBean
SSLServerSocketFactory.getDefault()
will be used or not. See
SSLSocketBuilderMBean.setUseSSLServerSocketFactory(boolean)
for more information on what this means.
getUseSSLServerSocketFactory
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.getUseSSLServerSocketFactory()
public void setUseSSLSocketFactory(boolean shouldUse)
SSLSocketBuilderMBean
SSLSocketFactory.getDefault()
when
creating the SocketFactory to use (when calling SSLSocketBuilderMBean.createSSLSocketFactory()
). If true
,
will allow for setting trust store location (via javax.net.ssl.trustStore
system property) and
setting of the key store password (via javax.net.ssl.trustStorePassword
system property) and no
other configuration is needed (none of the other setters will need to be called and are in fact ignored). If
set to false
, will allow the custom setting of secure socket protocol, key store management
algorithm, file location, password among other things.
The default value is true
.
NOTE: If this is not explicitly set to false
, no customizations can be made and the
default implementation provided by the JVM vendor being used will be executed.
setUseSSLSocketFactory
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.setUseSSLSocketFactory(boolean)
public boolean getUseSSLSocketFactory()
SSLSocketBuilderMBean
SSLSocketFactory.getDefault()
will be used or not. See
SSLSocketBuilderMBean.setUseSSLSocketFactory(boolean)
for more information on what this means.
getUseSSLSocketFactory
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.getUseSSLSocketFactory()
public javax.net.ServerSocketFactory createSSLServerSocketFactory() throws java.io.IOException
SSLSocketBuilderMBean
SSLServerSocketFactory
. If the SSLSocketBuilderMBean.getUseSSLServerSocketFactory()
property is
set to true
(which is the default), it will use SSLServerSocketFactory.getDefault()
to get the server socket factory. Otherwise, if property is false
, will use all the other custom
properties that have been set to create a custom server socket factory.
createSSLServerSocketFactory
in interface SSLSocketBuilderMBean
java.io.IOException
SSLSocketBuilderMBean.createSSLServerSocketFactory()
public javax.net.ServerSocketFactory createSSLServerSocketFactory(CustomSSLServerSocketFactory wrapper) throws java.io.IOException
SSLSocketBuilderMBean
SSLServerSocketFactory
. If the SSLSocketBuilderMBean.getUseSSLServerSocketFactory()
property is
set to true
(which is the default), it will use SSLServerSocketFactory.getDefault()
to get the server socket factory. Otherwise, if property is false
, will use all the other custom
properties that have been set to create a custom server socket factory. The given custom factory will be used
as the wrapper around the factory created by this method and will be the factory returned. If it is
null
, one will be created and returned.
createSSLServerSocketFactory
in interface SSLSocketBuilderMBean
wrapper
- the wrapper that will contain the created factory - used so the caller can further customize
the factory and its sockets as desired (may be null
)
null
)
java.io.IOException
SSLSocketBuilderMBean.createSSLServerSocketFactory(org.jboss.remoting.security.CustomSSLServerSocketFactory)
protected javax.net.ServerSocketFactory createCustomServerSocketFactory(CustomSSLServerSocketFactory wrapper) throws java.io.IOException
wrapper
- the wrapper where the created factory will be stored
java.io.IOException
public javax.net.SocketFactory createSSLSocketFactory() throws java.io.IOException
SSLSocketBuilderMBean
SSLSocketFactory
. If the SSLSocketBuilderMBean.getUseSSLSocketFactory()
property is set to
true
(which is the default), it will use SSLSocketFactory.getDefault()
to get the
socket factory. Otherwise, if property is false
, will use all the other custom properties that
have been set to create a custom server socket factory.
createSSLSocketFactory
in interface SSLSocketBuilderMBean
java.io.IOException
SSLSocketBuilderMBean.createSSLSocketFactory()
public javax.net.SocketFactory createSSLSocketFactory(CustomSSLSocketFactory wrapper) throws java.io.IOException
SSLSocketBuilderMBean
SSLSocketFactory
. If the SSLSocketBuilderMBean.getUseSSLSocketFactory()
property is set to
true
(which is the default), it will use SSLSocketFactory.getDefault()
to get the
socket factory. Otherwise, if property is false
, will use all the other custom properties that
have been set to create a custom server socket factory. The given custom factory will be used as the wrapper
around the factory created by this method and will be the factory returned. If it is null
, one
will be created and returned.
createSSLSocketFactory
in interface SSLSocketBuilderMBean
wrapper
- the wrapper that will contain the created factory - used so the caller can further customize
the factory and its sockets as desired (may be null
)
null
)
java.io.IOException
SSLSocketBuilderMBean.createSSLSocketFactory(org.jboss.remoting.security.CustomSSLSocketFactory)
protected javax.net.SocketFactory createCustomSocketFactory(CustomSSLSocketFactory wrapper) throws java.io.IOException
wrapper
- the wrapper where the created factory will be stored
java.io.IOException
public javax.net.ssl.SSLContext getServerSocketFactorySSLContext()
SSLSocketBuilderMBean
null
until
the context is initialized.
getServerSocketFactorySSLContext
in interface SSLSocketBuilderMBean
null
if it hasn't been initialized yetSSLSocketBuilderMBean.getServerSocketFactorySSLContext()
public javax.net.ssl.SSLContext getSocketFactorySSLContext()
SSLSocketBuilderMBean
null
until the
context is initialized.
getSocketFactorySSLContext
in interface SSLSocketBuilderMBean
null
if it hasn't been initialized yetSSLSocketBuilderMBean.getSocketFactorySSLContext()
public java.lang.String getSecureSocketProtocol()
SSLSocketBuilderMBean
getSecureSocketProtocol
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.getSecureSocketProtocol()
public void setSecureSocketProtocol(java.lang.String protocol)
SSLSocketBuilderMBean
setSecureSocketProtocol
in interface SSLSocketBuilderMBean
protocol
- the secure socket protocol name (e.g. TLS)SSLSocketBuilderMBean.setSecureSocketProtocol(String)
public java.security.Provider getProvider()
SSLSocketBuilderMBean
getProvider
in interface SSLSocketBuilderMBean
null
if not specifically set
)SSLSocketBuilderMBean.getProvider()
public void setProvider(java.security.Provider provider)
SSLSocketBuilderMBean
setProvider
in interface SSLSocketBuilderMBean
provider
- the provider this object's SSL context should useSSLSocketBuilderMBean.setProvider(java.security.Provider)
public java.lang.String getProviderName()
SSLSocketBuilderMBean
getProviderName
in interface SSLSocketBuilderMBean
null
if not specifically set
or found in the configuration)SSLSocketBuilderMBean.getProviderName()
public void setProviderName(java.lang.String providerName)
SSLSocketBuilderMBean
setProviderName
in interface SSLSocketBuilderMBean
providerName
- identifies by name the provider this object's SSL context should useSSLSocketBuilderMBean.setProviderName(java.lang.String)
public java.security.SecureRandom getSecureRandom()
SSLSocketBuilderMBean
getSecureRandom
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.getSecureRandom()
public void setSecureRandom(java.security.SecureRandom secureRandom)
SSLSocketBuilderMBean
setSecureRandom
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.setSecureRandom(java.security.SecureRandom)
public java.lang.String getKeyStoreURL()
SSLSocketBuilderMBean
getKeyStoreURL
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.getKeyStoreURL()
public java.net.URL getKeyStore()
SSLSocketBuilderMBean
getKeyStore
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.getKeyStore()
public void setKeyStoreURL(java.lang.String keyStoreFilePath)
SSLSocketBuilderMBean
setKeyStoreURL
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.setKeyStoreURL(java.lang.String)
public void setKeyStore(java.net.URL keyStore)
SSLSocketBuilderMBean
setKeyStore
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.setKeyStore(java.net.URL)
public java.lang.String getKeyStoreType()
SSLSocketBuilderMBean
getKeyStoreType
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.getKeyStoreType()
public void setKeyStoreType(java.lang.String keyStoreType)
SSLSocketBuilderMBean
setKeyStoreType
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.setKeyStoreType(java.lang.String)
public java.lang.String getKeyStoreAlgorithm()
SSLSocketBuilderMBean
getKeyStoreAlgorithm
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.getKeyStoreAlgorithm()
public void setKeyStoreAlgorithm(java.lang.String algorithm)
SSLSocketBuilderMBean
setKeyStoreAlgorithm
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.setKeyStoreAlgorithm(java.lang.String)
public java.lang.String getKeyStorePassword()
public void setKeyStorePassword(java.lang.String keyStorePassword)
SSLSocketBuilderMBean
setKeyStorePassword
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.setKeyStorePassword(java.lang.String)
public java.lang.String getTrustStoreURL()
SSLSocketBuilderMBean
getTrustStoreURL
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.getTrustStoreURL()
public java.net.URL getTrustStore()
SSLSocketBuilderMBean
getTrustStore
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.getTrustStore()
public void setTrustStore(java.net.URL trustStore)
SSLSocketBuilderMBean
setTrustStore
in interface SSLSocketBuilderMBean
trustStore
- path to truststoreSSLSocketBuilderMBean.setTrustStore(java.net.URL)
public void setTrustStoreURL(java.lang.String trustStoreFilePath)
SSLSocketBuilderMBean
setTrustStoreURL
in interface SSLSocketBuilderMBean
trustStoreFilePath
- path to truststoreSSLSocketBuilderMBean.setTrustStoreURL(java.lang.String)
public java.lang.String getTrustStoreType()
SSLSocketBuilderMBean
getTrustStoreType
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.getTrustStoreType()
public void setTrustStoreType(java.lang.String trustStoreType)
SSLSocketBuilderMBean
setTrustStoreType
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.setTrustStoreType(java.lang.String)
public java.lang.String getTrustStoreAlgorithm()
SSLSocketBuilderMBean
getTrustStoreAlgorithm
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.getTrustStoreAlgorithm()
public void setTrustStoreAlgorithm(java.lang.String algorithm)
SSLSocketBuilderMBean
setTrustStoreAlgorithm
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.setTrustStoreAlgorithm(java.lang.String)
public java.lang.String getTrustStorePassword()
public void setTrustStorePassword(java.lang.String trustStorePassword)
SSLSocketBuilderMBean
setTrustStorePassword
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.setTrustStorePassword(java.lang.String)
public java.lang.String getKeyAlias()
SSLSocketBuilderMBean
getKeyAlias
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.getKeyAlias()
public void setKeyAlias(java.lang.String alias)
SSLSocketBuilderMBean
setKeyAlias
in interface SSLSocketBuilderMBean
alias
- the client key aliasSSLSocketBuilderMBean.setKeyAlias(java.lang.String)
public java.lang.String getKeyPassword()
null
but
when this value is needed by this class, the value for the key store
password will be used instead.
public void setKeyPassword(java.lang.String keyPassword)
SSLSocketBuilderMBean
setKeyPassword
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.setKeyPassword(java.lang.String)
public boolean isSocketUseClientMode()
SSLSocketBuilderMBean
isSocketUseClientMode
in interface SSLSocketBuilderMBean
true
if sockets should be in client modeSSLSocketBuilderMBean.isSocketUseClientMode()
public boolean isServerSocketUseClientMode()
SSLSocketBuilderMBean
isServerSocketUseClientMode
in interface SSLSocketBuilderMBean
true
if sockets should be in client modeSSLSocketBuilderMBean.isServerSocketUseClientMode()
public void setSocketUseClientMode(boolean useClientMode)
SSLSocketBuilderMBean
setSocketUseClientMode
in interface SSLSocketBuilderMBean
useClientMode
- true
if sockets should be in client modeSSLSocketBuilderMBean.setSocketUseClientMode(boolean)
public void setServerSocketUseClientMode(boolean useClientMode)
SSLSocketBuilderMBean
setServerSocketUseClientMode
in interface SSLSocketBuilderMBean
useClientMode
- true
if sockets should be in client modeSSLSocketBuilderMBean.setServerSocketUseClientMode(boolean)
public boolean isClientAuthModeNone()
SSLSocketBuilderMBean
SSLSocket.getUseClientMode
).
isClientAuthModeNone
in interface SSLSocketBuilderMBean
true
if client authentication should be disabled.SSLSocketBuilderMBean.isClientAuthModeNone()
public boolean isClientAuthModeWant()
SSLSocketBuilderMBean
SSLSocket.getUseClientMode
).
isClientAuthModeWant
in interface SSLSocketBuilderMBean
true
if client authentication should be enabled but isn't required.SSLSocketBuilderMBean.isClientAuthModeWant()
public boolean isClientAuthModeNeed()
SSLSocketBuilderMBean
SSLSocket.getUseClientMode
).
isClientAuthModeNeed
in interface SSLSocketBuilderMBean
true
if client authentication is requiredSSLSocketBuilderMBean.isClientAuthModeNeed()
public java.lang.String getClientAuthMode()
SSLSocketBuilderMBean
SSLSocket.getUseClientMode
).
If not set, CLIENT_AUTH_MODE_NONE
is returned.
getClientAuthMode
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.getClientAuthMode()
public void setClientAuthMode(java.lang.String mode)
SSLSocketBuilderMBean
SSLSocket.getUseClientMode
).
If mode
is invalid or null
, will default to
CLIENT_AUTH_MODE_NONE
.
setClientAuthMode
in interface SSLSocketBuilderMBean
mode
- client auth modeSSLSocketBuilderMBean.setClientAuthMode(java.lang.String)
public boolean isServerAuthMode()
SSLSocketBuilderMBean
isServerAuthMode
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.isServerAuthMode()
public void setServerAuthMode(boolean mode)
SSLSocketBuilderMBean
setServerAuthMode
in interface SSLSocketBuilderMBean
mode
- server auth modeSSLSocketBuilderMBean.setServerAuthMode(boolean)
protected void createServerSocketFactorySSLContext() throws java.io.IOException
initializeServerSocketFactorySSLContext()
if you want
to create and initialize in one method call.
If the server socket factory SSL context was already created, this will create
a new one and remove the old one.
java.io.IOException
protected void createSocketFactorySSLContext() throws java.io.IOException
initializeSocketFactorySSLContext()
if you want
to create and initialize in one method call.
If the socket factory SSL context was already created, this will create
a new one and remove the old one.
java.io.IOException
protected void initializeServerSocketFactorySSLContext() throws java.io.IOException
java.io.IOException
protected void initializeSocketFactorySSLContext() throws java.io.IOException
java.io.IOException
protected javax.net.ssl.TrustManager[] loadTrustManagers(boolean isClientMode) throws java.security.NoSuchProviderException, java.security.NoSuchAlgorithmException, java.io.IOException, java.security.cert.CertificateException, java.security.KeyStoreException, SSLSocketBuilder.NullStoreURLException
java.security.NoSuchProviderException
java.security.NoSuchAlgorithmException
java.io.IOException
java.security.cert.CertificateException
java.security.KeyStoreException
SSLSocketBuilder.NullStoreURLException
protected javax.net.ssl.KeyManager[] loadKeyManagers() throws java.security.NoSuchProviderException, java.security.NoSuchAlgorithmException, java.io.IOException, java.security.cert.CertificateException, java.security.KeyStoreException, java.security.UnrecoverableKeyException, SSLSocketBuilder.NullStoreURLException
java.security.NoSuchProviderException
java.security.NoSuchAlgorithmException
java.io.IOException
java.security.cert.CertificateException
java.security.KeyStoreException
java.security.UnrecoverableKeyException
SSLSocketBuilder.NullStoreURLException
protected java.security.KeyStore loadKeyStore(java.lang.String storeType, java.net.URL storePathURL, java.lang.String storePassword) throws java.security.KeyStoreException, java.security.NoSuchProviderException, java.io.IOException, java.security.NoSuchAlgorithmException, java.security.cert.CertificateException, SSLSocketBuilder.NullStoreURLException
storeType
- the type of store filestorePathURL
- the URL to the file - may be relative to the current thread's classloader
or may be absolute path to a file on the file system.storePassword
- password to gain access to the store file
java.security.KeyStoreException
java.security.NoSuchProviderException
java.io.IOException
java.security.NoSuchAlgorithmException
java.security.cert.CertificateException
SSLSocketBuilder.NullStoreURLException
protected java.net.URL validateStoreURL(java.lang.String storePath) throws java.io.IOException
storePath
- the path which can be a URL, path to a resource in classloader
or a file path on the file system.
java.io.IOException
- if the store could not be foundpublic java.lang.Object clone()
SSLSocketBuilderMBean
clone
in interface SSLSocketBuilderMBean
clone
in class java.lang.Object
public void create() throws java.lang.Exception
SSLSocketBuilderMBean
create
in interface SSLSocketBuilderMBean
java.lang.Exception
SSLSocketBuilderMBean.create()
public void start() throws java.lang.Exception
SSLSocketBuilderMBean
start
in interface SSLSocketBuilderMBean
java.lang.Exception
SSLSocketBuilderMBean.start()
public void stop()
SSLSocketBuilderMBean
stop
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.stop()
public void destroy()
SSLSocketBuilderMBean
destroy
in interface SSLSocketBuilderMBean
SSLSocketBuilderMBean.destroy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |