public class DefaultSSLContextFactory extends Object implements SSLContextFactory
SSLContextFactory.SSLContextFactoryException| Modifier and Type | Field and Description |
|---|---|
static String |
CONTEXT_PROTOCOL_NAME_PROP |
static String |
CONTEXT_PROVIDER_NAME_PROP |
static String |
SECURERANDOM_ALGORITHM_PROP |
static String |
SECURERANDOM_PROVIDER_NAME_PROP |
| Constructor and Description |
|---|
DefaultSSLContextFactory() |
| Modifier and Type | Method and Description |
|---|---|
SSLContext |
buildSSLContext()
Creates a new SSLContext with the context protocol set with
setContextProtocol(String).
|
SSLContext |
buildSSLContext(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(Properties properties)
Configures some this factory based on values in the properties.
|
String |
getContextProtocol()
Returns the protocol to be used for creating a new SSLContext.
|
Provider |
getContextProvider()
Returns the Provider that is used for creating the SSLContext.
|
String |
getDefaultSecureRandomAlgorithm()
Returns the default SecureRandom algorithm.
|
KeyManager[] |
getKeyManagers()
Returns the KeyManagers to be used for initialising the SSLContext.
|
SecureRandom |
getSecureRandom()
Returns the SecureRandom to be used for initialising the SSLContext.
|
Provider |
getSecureRandomProvider()
Returns the default SecureRandom Provider.
|
TrustManager[] |
getTrustManagers()
Returns the TrustManagers to be used for initialising the SSLContext.
|
void |
setSecureRandom(SecureRandom secureRandom)
Sets the SecureRandom to be used for initialising the SSLContext.
|
public static final String CONTEXT_PROVIDER_NAME_PROP
public static final String CONTEXT_PROTOCOL_NAME_PROP
public static final String SECURERANDOM_PROVIDER_NAME_PROP
public static final String SECURERANDOM_ALGORITHM_PROP
public void configure(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 SSLContextFactoryproperties - properties to use for the configuration.SSLContextFactory.SSLContextFactoryExceptionpublic Provider getContextProvider()
public String getContextProtocol()
public Provider getSecureRandomProvider()
public String getDefaultSecureRandomAlgorithm()
public final SSLContext buildSSLContext() throws SSLContextFactory.SSLContextFactoryException
buildSSLContext in interface SSLContextFactorySSLContextFactoryExceptionSSLContextFactory.SSLContextFactoryExceptionpublic SSLContext buildSSLContext(String contextProtocol) throws SSLContextFactory.SSLContextFactoryException
contextProtocol - SSLContext protocol.SSLContextFactoryExceptionSSLContextFactory.SSLContextFactoryExceptionpublic KeyManager[] getKeyManagers() throws SSLContextFactory.SSLContextFactoryException
SSLContextFactoryExceptionSSLContextFactory.SSLContextFactoryExceptionpublic TrustManager[] getTrustManagers() throws SSLContextFactory.SSLContextFactoryException
SSLContextFactoryExceptionSSLContextFactory.SSLContextFactoryExceptionpublic void setSecureRandom(SecureRandom secureRandom)
secureRandom - the secureRandom to setpublic SecureRandom getSecureRandom() throws SSLContextFactory.SSLContextFactoryException
SSLContextFactoryExceptionSSLContextFactory.SSLContextFactoryExceptionprotected final DefaultSSLContextFactory clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionCopyright © 2017. All rights reserved.