|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.grizzly.ssl.SSLContextConfigurator
public class SSLContextConfigurator
Utility class, which helps to configure SSLContext.
| Field Summary | |
|---|---|
static SSLContextConfigurator |
DEFAULT_CONFIG
Default SSL configuration. |
static java.lang.String |
KEY_FACTORY_MANAGER_ALGORITHM
|
static java.lang.String |
KEY_STORE_FILE
|
static java.lang.String |
KEY_STORE_PASSWORD
|
static java.lang.String |
KEY_STORE_PROVIDER
|
static java.lang.String |
KEY_STORE_TYPE
|
static java.lang.String |
TRUST_FACTORY_MANAGER_ALGORITHM
|
static java.lang.String |
TRUST_STORE_FILE
|
static java.lang.String |
TRUST_STORE_PASSWORD
|
static java.lang.String |
TRUST_STORE_PROVIDER
|
static java.lang.String |
TRUST_STORE_TYPE
|
| Constructor Summary | |
|---|---|
SSLContextConfigurator()
Default constructor. |
|
SSLContextConfigurator(boolean readSystemProperties)
Constructor that allows you creating empty configuration. |
|
| Method Summary | |
|---|---|
javax.net.ssl.SSLContext |
createSSLContext()
|
void |
retrieve(java.util.Properties props)
|
void |
setKeyManagerFactoryAlgorithm(java.lang.String keyManagerFactoryAlgorithm)
Sets the key manager factory algorithm. |
void |
setKeyPass(char[] keyPass)
Password of the key in the key store. |
void |
setKeyPass(java.lang.String keyPass)
Password of the key in the key store. |
void |
setKeyStoreFile(java.lang.String keyStoreFile)
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 |
setKeyStorePass(char[] keyStorePass)
Password of key store. |
void |
setKeyStorePass(java.lang.String keyStorePass)
Password of key store. |
void |
setKeyStoreProvider(java.lang.String keyStoreProvider)
Sets the key store provider name. |
void |
setKeyStoreType(java.lang.String keyStoreType)
Type of key store. |
void |
setSecurityProtocol(java.lang.String securityProtocol)
Sets the SSLContext protocol. |
void |
setTrustManagerFactoryAlgorithm(java.lang.String trustManagerFactoryAlgorithm)
Sets the trust manager factory algorithm. |
void |
setTrustStoreFile(java.lang.String trustStoreFile)
Sets trust store file name, also makes sute that if other trust store configuration parameters are not set to set them to default values. |
void |
setTrustStorePass(java.lang.String trustStorePass)
Password of trust store. |
void |
setTrustStoreProvider(java.lang.String trustStoreProvider)
Sets the trust store provider name. |
void |
setTrustStoreType(java.lang.String trustStoreType)
Type of trust store. |
boolean |
validateConfiguration()
Validates SSLContextConfigurator configuration. |
boolean |
validateConfiguration(boolean needsKeyStore)
Validates SSLContextConfigurator configuration. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String TRUST_STORE_PROVIDER
public static final java.lang.String KEY_STORE_PROVIDER
public static final java.lang.String TRUST_STORE_FILE
public static final java.lang.String KEY_STORE_FILE
public static final java.lang.String TRUST_STORE_PASSWORD
public static final java.lang.String KEY_STORE_PASSWORD
public static final java.lang.String TRUST_STORE_TYPE
public static final java.lang.String KEY_STORE_TYPE
public static final java.lang.String KEY_FACTORY_MANAGER_ALGORITHM
public static final java.lang.String TRUST_FACTORY_MANAGER_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).
| Constructor Detail |
|---|
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.| Method Detail |
|---|
public void setTrustStoreProvider(java.lang.String trustStoreProvider)
trustStoreProvider - Trust store provider to set.public void setKeyStoreProvider(java.lang.String keyStoreProvider)
keyStoreProvider - Key store provider to set.public void setTrustStoreType(java.lang.String trustStoreType)
trustStoreType - Type of trust store to set.public void setKeyStoreType(java.lang.String keyStoreType)
keyStoreType - Type of key store to set.public void setTrustStorePass(java.lang.String trustStorePass)
trustStorePass - Password of trust store to set.public void setKeyStorePass(java.lang.String keyStorePass)
keyStorePass - Password of key store to set.public void setKeyStorePass(char[] keyStorePass)
keyStorePass - Password of key store to set.public void setKeyPass(java.lang.String keyPass)
keyPass - Password of key to set.public void setKeyPass(char[] keyPass)
keyPass - Password of key to set.public void setTrustStoreFile(java.lang.String trustStoreFile)
trustStoreFile - File name of trust store.public void setKeyStoreFile(java.lang.String keyStoreFile)
keyStoreFile - File name of key store.public void setTrustManagerFactoryAlgorithm(java.lang.String trustManagerFactoryAlgorithm)
trustManagerFactoryAlgorithm - the trust manager factory algorithm.public void setKeyManagerFactoryAlgorithm(java.lang.String keyManagerFactoryAlgorithm)
keyManagerFactoryAlgorithm - the key manager factory algorithm.public void setSecurityProtocol(java.lang.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 javax.net.ssl.SSLContext createSSLContext()
public void retrieve(java.util.Properties props)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||