|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jsslutils.sslcontext.DefaultSSLContextFactory
public class DefaultSSLContextFactory
This class is a factory that provides methods for creating an SSLContext configured with the settings set in this factory. It creates and initialises the SSLContext with init(getKeyManagers(), getTrustManagers(), getSecureRandom()), which all default to null. These three methods can be overridden.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.jsslutils.sslcontext.SSLContextFactory |
---|
SSLContextFactory.SSLContextFactoryException |
Field Summary | |
---|---|
static java.lang.String |
CONTEXT_PROTOCOL_NAME_PROP
|
static java.lang.String |
CONTEXT_PROVIDER_NAME_PROP
|
static java.lang.String |
SECURERANDOM_ALGORITHM_PROP
|
static java.lang.String |
SECURERANDOM_PROVIDER_NAME_PROP
|
Constructor Summary | |
---|---|
DefaultSSLContextFactory()
|
Method Summary | |
---|---|
javax.net.ssl.SSLContext |
buildSSLContext()
Creates a new SSLContext with the context protocol set with setContextProtocol(String). |
javax.net.ssl.SSLContext |
buildSSLContext(java.lang.String contextProtocol)
Creates a new SSLContext initialised with getKeyManagers(), getTrustManagers() and getSecureRandom(). |
protected DefaultSSLContextFactory |
clone()
SSLContextFactories are likely to contain sensitive information; cloning is therefore not allowed. |
void |
configure(java.util.Properties properties)
Configures some this factory based on values in the properties. |
java.lang.String |
getContextProtocol()
Returns the protocol to be used for creating a new SSLContext. |
java.security.Provider |
getContextProvider()
Returns the Provider that is used for creating the SSLContext. |
java.lang.String |
getDefaultSecureRandomAlgorithm()
Returns the default SecureRandom algorithm. |
javax.net.ssl.KeyManager[] |
getKeyManagers()
Returns the KeyManagers to be used for initialising the SSLContext. |
java.security.SecureRandom |
getSecureRandom()
Returns the SecureRandom to be used for initialising the SSLContext. |
java.security.Provider |
getSecureRandomProvider()
Returns the default SecureRandom Provider. |
javax.net.ssl.TrustManager[] |
getTrustManagers()
Returns the TrustManagers to be used for initialising the SSLContext. |
void |
setSecureRandom(java.security.SecureRandom secureRandom)
Sets the SecureRandom to be used for initialising the SSLContext. |
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 CONTEXT_PROVIDER_NAME_PROP
public static final java.lang.String CONTEXT_PROTOCOL_NAME_PROP
public static final java.lang.String SECURERANDOM_PROVIDER_NAME_PROP
public static final java.lang.String SECURERANDOM_ALGORITHM_PROP
Constructor Detail |
---|
public DefaultSSLContextFactory()
Method Detail |
---|
public void configure(java.util.Properties properties) throws SSLContextFactory.SSLContextFactoryException
Property name | Description |
---|---|
org.jsslutils.prop.contextProvider | Name of the security Provider to use to instantiate the
SSLContext . |
org.jsslutils.prop.contextProtocol | Name of the protocol for the SSLContext , defaults to TLS. |
org.jsslutils.prop.secureRandomProvider | Name of the security Provider to use to instantiate the
SecureRandom . |
org.jsslutils.prop.secureRandomAlgorithm | Name of the SecureRandom algorithm, defaults to null. |
configure
in interface SSLContextFactory
properties
- properties to use for the configuration.
SSLContextFactory.SSLContextFactoryException
public java.security.Provider getContextProvider()
public java.lang.String getContextProtocol()
public java.security.Provider getSecureRandomProvider()
public java.lang.String getDefaultSecureRandomAlgorithm()
public final javax.net.ssl.SSLContext buildSSLContext() throws SSLContextFactory.SSLContextFactoryException
buildSSLContext
in interface SSLContextFactory
SSLContextFactoryException
SSLContextFactory.SSLContextFactoryException
public javax.net.ssl.SSLContext buildSSLContext(java.lang.String contextProtocol) throws SSLContextFactory.SSLContextFactoryException
contextProtocol
- SSLContext protocol.
SSLContextFactoryException
SSLContextFactory.SSLContextFactoryException
public javax.net.ssl.KeyManager[] getKeyManagers() throws SSLContextFactory.SSLContextFactoryException
SSLContextFactoryException
SSLContextFactory.SSLContextFactoryException
public javax.net.ssl.TrustManager[] getTrustManagers() throws SSLContextFactory.SSLContextFactoryException
SSLContextFactoryException
SSLContextFactory.SSLContextFactoryException
public void setSecureRandom(java.security.SecureRandom secureRandom)
secureRandom
- the secureRandom to setpublic java.security.SecureRandom getSecureRandom() throws SSLContextFactory.SSLContextFactoryException
SSLContextFactoryException
SSLContextFactory.SSLContextFactoryException
protected final DefaultSSLContextFactory clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |