|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.grizzly.ssl.SSLContextConfigurator
public class SSLContextConfigurator
Utility class, which helps to configure SSLContext.
| Field Summary | |
|---|---|
static SSLContextConfigurator |
DEFAULT_CONFIG
Default SSL configuration. |
static String |
KEY_FACTORY_MANAGER_ALGORITHM
|
static String |
KEY_STORE_FILE
|
static String |
KEY_STORE_PASSWORD
|
static String |
KEY_STORE_PROVIDER
|
static String |
KEY_STORE_TYPE
|
static String |
TRUST_FACTORY_MANAGER_ALGORITHM
|
static String |
TRUST_STORE_FILE
|
static String |
TRUST_STORE_PASSWORD
|
static String |
TRUST_STORE_PROVIDER
|
static String |
TRUST_STORE_TYPE
|
| Constructor Summary | |
|---|---|
SSLContextConfigurator()
Default constructor. |
|
SSLContextConfigurator(boolean readSystemProperties)
Constructor that allows you creating empty configuration. |
|
| Method Summary | |
|---|---|
SSLContext |
createSSLContext()
|
boolean |
isClientMode()
|
boolean |
isNeedClientAuth()
|
boolean |
isWantClientAuth()
|
void |
retrieve(Properties props)
|
void |
setClientMode(boolean clientMode)
|
void |
setKeyManagerFactoryAlgorithm(String keyManagerFactoryAlgorithm)
Sets the key manager factory algorithm. |
void |
setKeyPass(char[] keyPass)
Password of the key in the key store. |
void |
setKeyPass(String keyPass)
Password of the key in the key store. |
void |
setKeyStoreFile(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(String keyStorePass)
Password of key store. |
void |
setKeyStoreProvider(String keyStoreProvider)
Sets the key store provider name. |
void |
setKeyStoreType(String keyStoreType)
Type of key store. |
void |
setNeedClientAuth(boolean needClientAuth)
|
void |
setSecurityProtocol(String securityProtocol)
Sets the SSLContext protocole. |
void |
setTrustManagerFactoryAlgorithm(String trustManagerFactoryAlgorithm)
Sets the trust manager factory algorithm. |
void |
setTrustStoreFile(String trustStoreFile)
Sets trust store file name, also makes sute that if other trust store configutation parameters are not set to set them to default values. |
void |
setTrustStorePass(String trustStorePass)
Password of trust store. |
void |
setTrustStoreProvider(String trustStoreProvider)
Sets the trust store provider name. |
void |
setTrustStoreType(String trustStoreType)
Type of trust store. |
void |
setWantClientAuth(boolean wantClientAuth)
|
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 String TRUST_STORE_PROVIDER
public static final String KEY_STORE_PROVIDER
public static final String TRUST_STORE_FILE
public static final String KEY_STORE_FILE
public static final String TRUST_STORE_PASSWORD
public static final String KEY_STORE_PASSWORD
public static final String TRUST_STORE_TYPE
public static final String KEY_STORE_TYPE
public static final String KEY_FACTORY_MANAGER_ALGORITHM
public static final 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(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 setTrustStorePass(String trustStorePass)
trustStorePass - Password of trust store to set.public void setKeyStorePass(String keyStorePass)
keyStorePass - Password of key store to set.public void setKeyStorePass(char[] keyStorePass)
keyStorePass - Password of key store to set.public void setKeyPass(String keyPass)
keyPass - Password of key to set.public void setKeyPass(char[] keyPass)
keyPass - Password of key to set.public void setTrustStoreFile(String trustStoreFile)
trustStoreFile - File name of trust store.public void setKeyStoreFile(String keyStoreFile)
keyStoreFile - File name of key store.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 isNeedClientAuth()
public void setNeedClientAuth(boolean needClientAuth)
public boolean isWantClientAuth()
public void setWantClientAuth(boolean wantClientAuth)
public boolean isClientMode()
public void setClientMode(boolean clientMode)
public boolean validateConfiguration()
SSLContextConfigurator configuration.
true iff configuration is valid, else
false.public boolean validateConfiguration(boolean needsKeyStore)
SSLContextConfigurator configuration.
needsKeyStore - forces failure if no keystore is specified.
true iff configuration is valid, else
false.public SSLContext createSSLContext()
public void retrieve(Properties props)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||