|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The service interface of the socket builder.
Method Summary | |
java.lang.Object |
clone()
Creates a clone. |
void |
create()
No-op - just needed for MBean service API. |
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.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 |
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 |
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. |
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. |
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 keyStoreURL)
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 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 createSSLSocketFactory() ). |
void |
start()
No-op - just needed for MBean service API. |
void |
stop()
No-op - just needed for MBean server API. |
Method Detail |
public void setUseSSLServerSocketFactory(boolean shouldUse)
SSLServerSocketFactory.getDefault()
when creating the ServerSocketFactory to use (when calling 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.
shouldUse
- public boolean getUseSSLServerSocketFactory()
SSLServerSocketFactory.getDefault()
will be used or not. See
setUseSSLServerSocketFactory(boolean)
for more information on what this means.
public void setUseSSLSocketFactory(boolean shouldUse)
SSLSocketFactory.getDefault()
when
creating the SocketFactory to use (when calling 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.
shouldUse
- public boolean getUseSSLSocketFactory()
SSLSocketFactory.getDefault()
will be used or not. See
setUseSSLSocketFactory(boolean)
for more information on what this means.
public javax.net.ServerSocketFactory createSSLServerSocketFactory() throws java.io.IOException
SSLServerSocketFactory
. If the 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.
java.io.IOException
public javax.net.ServerSocketFactory createSSLServerSocketFactory(CustomSSLServerSocketFactory wrapper) throws java.io.IOException
SSLServerSocketFactory
. If the 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.
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
public javax.net.SocketFactory createSSLSocketFactory() throws java.io.IOException
SSLSocketFactory
. If the 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.
java.io.IOException
public javax.net.SocketFactory createSSLSocketFactory(CustomSSLSocketFactory wrapper) throws java.io.IOException
SSLSocketFactory
. If the 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.
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
public javax.net.ssl.SSLContext getServerSocketFactorySSLContext()
null
until
the context is initialized.
null
if it hasn't been initialized yetpublic javax.net.ssl.SSLContext getSocketFactorySSLContext()
null
until the
context is initialized.
null
if it hasn't been initialized yetpublic java.lang.String getSecureSocketProtocol()
public void setSecureSocketProtocol(java.lang.String protocol)
protocol
- the secure socket protocol name (e.g. TLS)public java.security.Provider getProvider()
null
if not specifically set
)public void setProvider(java.security.Provider provider)
provider
- the provider this object's SSL context should usepublic java.lang.String getProviderName()
null
if not specifically set
or found in the configuration)public void setProviderName(java.lang.String providerName)
providerName
- identifies by name the provider this object's SSL context should usepublic java.security.SecureRandom getSecureRandom()
public void setSecureRandom(java.security.SecureRandom secureRandom)
secureRandom
- public java.net.URL getKeyStore()
public java.lang.String getKeyStoreURL()
public void setKeyStoreURL(java.lang.String keyStoreFilePath)
keyStoreFilePath
- public void setKeyStore(java.net.URL keyStoreURL)
keyStoreURL
- public java.lang.String getKeyStoreType()
public void setKeyStoreType(java.lang.String keyStoreType)
keyStoreType
- public java.lang.String getKeyStoreAlgorithm()
public void setKeyStoreAlgorithm(java.lang.String algorithm)
algorithm
- public void setKeyStorePassword(java.lang.String keyStorePassword)
keyStorePassword
- public java.net.URL getTrustStore()
public java.lang.String getTrustStoreURL()
public void setTrustStoreURL(java.lang.String trustStoreFilePath)
trustStoreFilePath
- path to truststorepublic void setTrustStore(java.net.URL trustStore)
trustStore
- path to truststorepublic java.lang.String getTrustStoreType()
public void setTrustStoreType(java.lang.String trustStoreType)
trustStoreType
- public java.lang.String getTrustStoreAlgorithm()
public void setTrustStoreAlgorithm(java.lang.String algorithm)
algorithm
- public void setTrustStorePassword(java.lang.String trustStorePassword)
trustStorePassword
- public java.lang.String getKeyAlias()
public void setKeyAlias(java.lang.String alias)
alias
- the client key aliaspublic void setKeyPassword(java.lang.String keyPassword)
keyPassword
- public boolean isSocketUseClientMode()
true
if sockets should be in client modepublic boolean isServerSocketUseClientMode()
true
if sockets should be in client modepublic void setSocketUseClientMode(boolean useClientMode)
useClientMode
- true
if sockets should be in client modepublic void setServerSocketUseClientMode(boolean useClientMode)
useClientMode
- true
if sockets should be in client modepublic boolean isClientAuthModeNone()
SSLSocket.getUseClientMode
).
true
if client authentication should be disabled.public boolean isClientAuthModeWant()
SSLSocket.getUseClientMode
).
true
if client authentication should be enabled but isn't required.public boolean isClientAuthModeNeed()
SSLSocket.getUseClientMode
).
true
if client authentication is requiredpublic java.lang.String getClientAuthMode()
SSLSocket.getUseClientMode
).
If not set, SSLSocketBuilder.CLIENT_AUTH_MODE_NONE
is returned.
SSLSocketBuilder.CLIENT_AUTH_MODE_NONE
,
SSLSocketBuilder.CLIENT_AUTH_MODE_WANT
,
SSLSocketBuilder.CLIENT_AUTH_MODE_NEED
public void setClientAuthMode(java.lang.String mode)
SSLSocket.getUseClientMode
).
If mode
is invalid or null
, will default to
SSLSocketBuilder.CLIENT_AUTH_MODE_NONE
.
mode
- client auth modeSSLSocketBuilder.CLIENT_AUTH_MODE_NONE
,
SSLSocketBuilder.CLIENT_AUTH_MODE_WANT
,
SSLSocketBuilder.CLIENT_AUTH_MODE_NEED
public boolean isServerAuthMode()
public void setServerAuthMode(boolean mode)
mode
- server auth modepublic java.lang.Object clone()
public void create() throws java.lang.Exception
java.lang.Exception
public void start() throws java.lang.Exception
java.lang.Exception
public void stop()
public void destroy()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |