SslContextConfigurator
.public class SslContextConfigurator extends Object
SslEngineConfigurator
, which will be passed to client via configuration properties.
Example:
SslContextConfigurator sslContextConfigurator = new SslContextConfigurator(); sslContextConfigurator.setTrustStoreFile("..."); sslContextConfigurator.setTrustStorePassword("..."); sslContextConfigurator.setTrustStoreType("..."); sslContextConfigurator.setKeyStoreFile("..."); sslContextConfigurator.setKeyStorePassword("..."); sslContextConfigurator.setKeyStoreType("..."); SslEngineConfigurator sslEngineConfigurator = new SslEngineConfigurator(sslContextConfigurator, true, false, false); client.getProperties().put(ClientManager.SSL_ENGINE_CONFIGURATOR, sslEngineConfigurator);
Modifier and Type | Field and Description |
---|---|
static SslContextConfigurator |
DEFAULT_CONFIG
Deprecated.
Default SSL configuration.
|
static String |
KEY_FACTORY_MANAGER_ALGORITHM
Deprecated.
Key manager factory algorithm name.
|
static String |
KEY_STORE_FILE
Deprecated.
Key store file name.
|
static String |
KEY_STORE_PASSWORD
Deprecated.
Key store file password - the password used to unlock the trust store file.
|
static String |
KEY_STORE_PROVIDER
Deprecated.
Key store provider name.
|
static String |
KEY_STORE_TYPE
Deprecated.
Key store type (see
KeyStore.getType() for more info). |
static String |
TRUST_FACTORY_MANAGER_ALGORITHM
Deprecated.
Trust manager factory algorithm name.
|
static String |
TRUST_STORE_FILE
Deprecated.
Trust store file name.
|
static String |
TRUST_STORE_PASSWORD
Deprecated.
Trust store file password - the password used to unlock the trust store file.
|
static String |
TRUST_STORE_PROVIDER
Deprecated.
Trust store provider name.
|
static String |
TRUST_STORE_TYPE
Deprecated.
Trust store type (see
KeyStore.getType() for more info). |
Constructor and Description |
---|
SslContextConfigurator()
Deprecated.
Default constructor.
|
SslContextConfigurator(boolean readSystemProperties)
Deprecated.
Constructor that allows you creating empty configuration.
|
Modifier and Type | Method and Description |
---|---|
SSLContext |
createSSLContext()
Deprecated.
|
void |
retrieve(Properties props)
Deprecated.
|
void |
setKeyManagerFactoryAlgorithm(String keyManagerFactoryAlgorithm)
Deprecated.
Sets the key manager factory algorithm.
|
void |
setKeyPassword(char[] keyPassword)
Deprecated.
Password of the key in the key store.
|
void |
setKeyPassword(String keyPassword)
Deprecated.
Password of the key in the key store.
|
void |
setKeyStoreBytes(byte[] keyStoreBytes)
Deprecated.
Sets key store payload as byte array.
|
void |
setKeyStoreFile(String keyStoreFile)
Deprecated.
Sets key store file name, also makes sure that if other key store
configuration parameters are not set to set them to default values.
|
void |
setKeyStorePassword(char[] keyStorePassword)
Deprecated.
Password of key store.
|
void |
setKeyStorePassword(String keyStorePassword)
Deprecated.
Password of key store.
|
void |
setKeyStoreProvider(String keyStoreProvider)
Deprecated.
Sets the key store provider name.
|
void |
setKeyStoreType(String keyStoreType)
Deprecated.
Type of key store.
|
void |
setSecurityProtocol(String securityProtocol)
Deprecated.
Sets the SSLContext protocol.
|
void |
setTrustManagerFactoryAlgorithm(String trustManagerFactoryAlgorithm)
Deprecated.
Sets the trust manager factory algorithm.
|
void |
setTrustStoreBytes(byte[] trustStoreBytes)
Deprecated.
Sets trust store payload as byte array.
|
void |
setTrustStoreFile(String trustStoreFile)
Deprecated.
Sets trust store file name, also makes sure that if other trust store
configuration parameters are not set to set them to default values.
|
void |
setTrustStorePassword(String trustStorePassword)
Deprecated.
Password of trust store.
|
void |
setTrustStoreProvider(String trustStoreProvider)
Deprecated.
Sets the trust store provider name.
|
void |
setTrustStoreType(String trustStoreType)
Deprecated.
Type of trust store.
|
boolean |
validateConfiguration()
Deprecated.
Validates
SslContextConfigurator configuration. |
boolean |
validateConfiguration(boolean needsKeyStore)
Deprecated.
Validates
SslContextConfigurator configuration. |
public static final String TRUST_STORE_PROVIDER
String
representing the name of a trust store provider.
No default value is set.
The name of the configuration property is "javax.net.ssl.trustStoreProvider".
public static final String KEY_STORE_PROVIDER
String
representing the name of a trust store provider.
No default value is set.
The name of the configuration property is "javax.net.ssl.keyStoreProvider".
public static final String TRUST_STORE_FILE
String
representing the name of a trust store file.
No default value is set.
The name of the configuration property is "javax.net.ssl.trustStore".
public static final String KEY_STORE_FILE
String
representing the name of a key store file.
No default value is set.
The name of the configuration property is "javax.net.ssl.keyStore".
public static final String TRUST_STORE_PASSWORD
String
representing the trust store file password.
No default value is set.
The name of the configuration property is "javax.net.ssl.trustStorePassword".
public static final String KEY_STORE_PASSWORD
String
representing the key store file password.
No default value is set.
The name of the configuration property is "javax.net.ssl.keyStorePassword".
public static final String TRUST_STORE_TYPE
KeyStore.getType()
for more info).
The value MUST be a String
representing the trust store type name.
No default value is set.
The name of the configuration property is "javax.net.ssl.trustStoreType".
public static final String KEY_STORE_TYPE
KeyStore.getType()
for more info).
The value MUST be a String
representing the key store type name.
No default value is set.
The name of the configuration property is "javax.net.ssl.keyStoreType".
public static final String KEY_FACTORY_MANAGER_ALGORITHM
String
representing the key manager factory algorithm name.
No default value is set.
The name of the configuration property is "ssl.KeyManagerFactory.algorithm".
public static final String TRUST_FACTORY_MANAGER_ALGORITHM
String
representing the trust manager factory algorithm name.
No default value is set.
The name of the configuration property is "ssl.TrustManagerFactory.algorithm".
public static final SslContextConfigurator DEFAULT_CONFIG
System.getProperties()
of javax.net.ssl family you should refresh
this configuration by calling retrieve(java.util.Properties)
.public SslContextConfigurator()
System.getProperties()
. Calls SslContextConfigurator(boolean)
with
true
.public SslContextConfigurator(boolean readSystemProperties)
readSystemProperties
- If true
populates configuration from
System.getProperties()
, else you have empty
configuration.public void setTrustStoreProvider(String trustStoreProvider)
trustStoreProvider
- Trust store provider to set.public void setKeyStoreProvider(String keyStoreProvider)
keyStoreProvider
- Key store provider to set.public void setTrustStoreType(String trustStoreType)
trustStoreType
- Type of trust store to set.public void setKeyStoreType(String keyStoreType)
keyStoreType
- Type of key store to set.public void setTrustStorePassword(String trustStorePassword)
trustStorePassword
- Password of trust store to set.public void setKeyStorePassword(String keyStorePassword)
keyStorePassword
- Password of key store to set.public void setKeyStorePassword(char[] keyStorePassword)
keyStorePassword
- Password of key store to set.public void setKeyPassword(String keyPassword)
keyPassword
- Password of key to set.public void setKeyPassword(char[] keyPassword)
keyPassword
- Password of key to set.public void setTrustStoreFile(String trustStoreFile)
setTrustStoreBytes(byte[])
.trustStoreFile
- File name of trust store.public void setTrustStoreBytes(byte[] trustStoreBytes)
setTrustStoreFile(java.lang.String)
.trustStoreBytes
- trust store payload.public void setKeyStoreFile(String keyStoreFile)
setKeyStoreBytes(byte[])
.keyStoreFile
- File name of key store.public void setKeyStoreBytes(byte[] keyStoreBytes)
setKeyStoreFile(java.lang.String)
.keyStoreBytes
- key store payload.public void setTrustManagerFactoryAlgorithm(String trustManagerFactoryAlgorithm)
trustManagerFactoryAlgorithm
- the trust manager factory algorithm.public void setKeyManagerFactoryAlgorithm(String keyManagerFactoryAlgorithm)
keyManagerFactoryAlgorithm
- the key manager factory algorithm.public void setSecurityProtocol(String securityProtocol)
TLS
if
this is null.securityProtocol
- Protocol for SSLContext.getProtocol()
.public boolean validateConfiguration()
SslContextConfigurator
configuration.true
if configuration is valid, else
false
.public boolean validateConfiguration(boolean needsKeyStore)
SslContextConfigurator
configuration.needsKeyStore
- forces failure if no keystore is specified.true
if configuration is valid, else
false
.public SSLContext createSSLContext()
public void retrieve(Properties props)
Copyright © 2012-2015, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.