|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jsslutils.sslcontext.DefaultSSLContextFactory
org.jsslutils.sslcontext.X509SSLContextFactory
public class X509SSLContextFactory
This class is a factory that provides methods for creating an SSLContext configured with the settings set in this factory: using the SunX509 algorithm for both the key manager and the trust manager. These managers are created from the KeyStores passed to the constructor. Unlike the PKIX implementation, this implementation does not support CRLs.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.jsslutils.sslcontext.SSLContextFactory |
---|
SSLContextFactory.SSLContextFactoryException |
Field Summary | |
---|---|
static String |
KEY_PASSWORD_PROP
|
static String |
KEYSTORE_FILE_PROP
|
static String |
KEYSTORE_PASSWORD_PROP
|
static String |
KEYSTORE_PROVIDER_ARGFILE_PROP
|
static String |
KEYSTORE_PROVIDER_ARGTEXT_PROP
|
static String |
KEYSTORE_PROVIDER_CLASS_PROP
|
static String |
KEYSTORE_PROVIDER_PROP
|
static String |
KEYSTORE_TYPE_PROP
|
static String |
TRUSTSTORE_FILE_PROP
|
static String |
TRUSTSTORE_PASSWORD_PROP
|
static String |
TRUSTSTORE_PROVIDER_ARGFILE_PROP
|
static String |
TRUSTSTORE_PROVIDER_ARGTEXT_PROP
|
static String |
TRUSTSTORE_PROVIDER_CLASS_PROP
|
static String |
TRUSTSTORE_PROVIDER_PROP
|
static String |
TRUSTSTORE_TYPE_PROP
|
Fields inherited from class org.jsslutils.sslcontext.DefaultSSLContextFactory |
---|
CONTEXT_PROTOCOL_NAME_PROP, CONTEXT_PROVIDER_NAME_PROP, SECURERANDOM_ALGORITHM_PROP, SECURERANDOM_PROVIDER_NAME_PROP |
Constructor Summary | |
---|---|
X509SSLContextFactory()
Builds an SSLContextFactory using the SunX509 algorithm in the TrustManagerFactory. |
|
X509SSLContextFactory(KeyStore keyStore,
char[] keyPassword,
KeyStore trustStore)
Builds an SSLContextFactory using the SunX509 algorithm in the TrustManagerFactory. |
|
X509SSLContextFactory(KeyStore keyStore,
String keyPassword,
KeyStore trustStore)
Builds an SSLContextFactory using the SunX509 algorithm in the TrustManagerFactory. |
Method Summary | |
---|---|
void |
configure(Properties properties)
Configures some this factory based on values in the properties. |
KeyManager[] |
getKeyManagers()
Gets the trust managers. |
protected KeyStore |
getKeyStore()
Returns the key store. |
protected KeyManager[] |
getRawKeyManagers()
Builds KeyManagers from the key store provided in the constructor, using a SunX509 KeyManagerFactory. |
protected TrustManager[] |
getRawTrustManagers()
Builds TrustManagers from the trust store provided in the constructor, using a SunX509 TrustManagerFactory. |
TrustManager[] |
getTrustManagers()
Gets the trust managers. |
protected KeyStore |
getTrustStore()
Returns the trust store. |
void |
setKeyManagerWrapper(X509KeyManagerWrapper keyManagerWrapper)
Sets the key manager wrapper. |
void |
setKeyPassword(char[] keyPassword)
Sets the key password |
void |
setKeyPasswordCallbackHandler(CallbackHandler keyPasswordCallbackHandler)
Sets the CallbackHandler that will be used to obtain the key password if this password is still null. |
void |
setKeyStore(KeyStore keyStore)
Sets the key store. |
void |
setKeyStorePasswordCallbackHandler(CallbackHandler keyStorePasswordCallbackHandler)
Sets the CallbackHandler that will be used to obtain the key password if this password is still null. |
void |
setTrustManagerWrapper(X509TrustManagerWrapper trustManagerWrapper)
Sets the trust manager wrapper. |
void |
setTrustStore(KeyStore trustStore)
Sets the trust store. |
void |
setTrustStorePasswordCallbackHandler(CallbackHandler trustStorePasswordCallbackHandler)
Sets the CallbackHandler that will be used to obtain the key password if this password is still null. |
Methods inherited from class org.jsslutils.sslcontext.DefaultSSLContextFactory |
---|
buildSSLContext, buildSSLContext, clone, getContextProtocol, getContextProvider, getDefaultSecureRandomAlgorithm, getSecureRandom, getSecureRandomProvider, setSecureRandom |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String KEYSTORE_FILE_PROP
public static final String KEYSTORE_TYPE_PROP
public static final String KEYSTORE_PROVIDER_PROP
public static final String KEYSTORE_PASSWORD_PROP
public static final String KEYSTORE_PROVIDER_CLASS_PROP
public static final String KEYSTORE_PROVIDER_ARGFILE_PROP
public static final String KEYSTORE_PROVIDER_ARGTEXT_PROP
public static final String KEY_PASSWORD_PROP
public static final String TRUSTSTORE_FILE_PROP
public static final String TRUSTSTORE_TYPE_PROP
public static final String TRUSTSTORE_PROVIDER_PROP
public static final String TRUSTSTORE_PASSWORD_PROP
public static final String TRUSTSTORE_PROVIDER_CLASS_PROP
public static final String TRUSTSTORE_PROVIDER_ARGFILE_PROP
public static final String TRUSTSTORE_PROVIDER_ARGTEXT_PROP
Constructor Detail |
---|
public X509SSLContextFactory()
public X509SSLContextFactory(KeyStore keyStore, String keyPassword, KeyStore trustStore)
keyStore
- KeyStore that contains the key.keyPassword
- password to the key.trustStore
- KeyStore that contains the trusted X.509 certificates.public X509SSLContextFactory(KeyStore keyStore, char[] keyPassword, KeyStore trustStore)
keyStore
- KeyStore that contains the key.keyPassword
- password to the key.trustStore
- KeyStore that contains the trusted X.509 certificates.Method Detail |
---|
public void configure(Properties properties) throws SSLContextFactory.SSLContextFactoryException
DefaultSSLContextFactory.configure(Properties)
, the following
properties are used:
Property name | Description |
---|---|
org.jsslutils.prop.keyStore | Path to the KeyStore file to use as the keystore; use "NONE"
if it's not file-based. |
org.jsslutils.prop.keyStoreType | Keystore type for the keystore. |
org.jsslutils.prop.keyStoreProvider | Name of the security Provider to use to load the keystore. |
org.jsslutils.prop.keyStorePassword | Password to load the keystore. |
org.jsslutils.prop.keyStoreProviderClass | Name of the Provider class to use to load the keystore,
typically used with a provider arg file or text; this takes precedence
over loading via provider name. |
org.jsslutils.prop.keyStoreProviderArgFile | Path to the file to use as an argument when instantiating the
keystore Provider via its class name |
org.jsslutils.prop.keyStoreProviderArgText | Text content of the argument when instantiating the keystore
Provider via its class name. |
org.jsslutils.prop.keyPassword | Password to use the key itself from the keystore. |
org.jsslutils.prop.trustStore | Path to the KeyStore file to use as the truststore; use
"NONE" if it's not file-based. |
org.jsslutils.prop.trustStoreType | Keystore type for the truststore. |
org.jsslutils.prop.trustStoreProvider | Name of the security Provider to use to load the truststore. |
org.jsslutils.prop.trustStorePassword | Password to load the truststore. |
org.jsslutils.prop.trustStoreProviderClass | Name of the Provider class to use to load the truststore,
typically used with a provider arg file or text; this takes precedence
over loading via provider name. |
org.jsslutils.prop.trustStoreProviderArgFile | Path to the file to use as an argument when instantiating the
truststore Provider via its class name |
org.jsslutils.prop.trustStoreProviderArgText | Text content of the argument when instantiating the truststore
Provider via its class name. |
configure
in interface SSLContextFactory
configure
in class DefaultSSLContextFactory
properties
- properties to use for the configuration.
SSLContextFactory.SSLContextFactoryException
public void setKeyStore(KeyStore keyStore)
keyStore
- the key store.public void setTrustStore(KeyStore trustStore)
trustStore
- the trust store.protected KeyStore getKeyStore()
protected KeyStore getTrustStore()
public void setKeyPassword(char[] keyPassword)
keyPassword
- public void setKeyPasswordCallbackHandler(CallbackHandler keyPasswordCallbackHandler)
keyPasswordCallbackHandler
- CallbackHandler that will be used to get the password.public void setKeyStorePasswordCallbackHandler(CallbackHandler keyStorePasswordCallbackHandler)
keyStorePasswordCallbackHandler
- CallbackHandler that will be used to get the password.public void setTrustStorePasswordCallbackHandler(CallbackHandler trustStorePasswordCallbackHandler)
trustStorePasswordCallbackHandler
- CallbackHandler that will be used to get the password.protected KeyManager[] getRawKeyManagers() throws SSLContextFactory.SSLContextFactoryException
SSLContextFactory.SSLContextFactoryException
public void setKeyManagerWrapper(X509KeyManagerWrapper keyManagerWrapper)
keyManagerWrapper
- public KeyManager[] getKeyManagers() throws SSLContextFactory.SSLContextFactoryException
getKeyManagers
in class DefaultSSLContextFactory
SSLContextFactory.SSLContextFactoryException
protected TrustManager[] getRawTrustManagers() throws SSLContextFactory.SSLContextFactoryException
SSLContextFactory.SSLContextFactoryException
public void setTrustManagerWrapper(X509TrustManagerWrapper trustManagerWrapper)
trustManagerWrapper
- public TrustManager[] getTrustManagers() throws SSLContextFactory.SSLContextFactoryException
getTrustManagers
in class DefaultSSLContextFactory
SSLContextFactory.SSLContextFactoryException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |