Configurable, KeyStoresFactory@Private @Evolving public class FileBasedKeyStoresFactory extends java.lang.Object implements KeyStoresFactory
KeyStoresFactory implementation that reads the certificates from
keystore files.
If either the truststore or the keystore certificates file changes, it
would be refreshed under the corresponding wrapper implementation -
ReloadingX509KeystoreManager or ReloadingX509TrustManager.
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
DEFAULT_KEYSTORE_TYPE |
Default format of the keystore files.
|
static int |
DEFAULT_SSL_STORES_RELOAD_INTERVAL |
The default time interval in milliseconds used to check if either
of the truststore or keystore certificates file has changed and needs reloading.
|
static java.lang.String |
SSL_EXCLUDE_CIPHER_LIST |
|
static java.lang.String |
SSL_KEYSTORE_KEYPASSWORD_TPL_KEY |
|
static java.lang.String |
SSL_KEYSTORE_LOCATION_TPL_KEY |
|
static java.lang.String |
SSL_KEYSTORE_PASSWORD_TPL_KEY |
|
static java.lang.String |
SSL_KEYSTORE_TYPE_TPL_KEY |
|
static java.lang.String |
SSL_MONITORING_THREAD_NAME |
The name of the timer thread monitoring file changes.
|
static java.lang.String |
SSL_STORES_RELOAD_INTERVAL_TPL_KEY |
The refresh interval used to check if either of the truststore or keystore
certificate file has changed.
|
static java.lang.String |
SSL_TRUSTSTORE_LOCATION_TPL_KEY |
|
static java.lang.String |
SSL_TRUSTSTORE_PASSWORD_TPL_KEY |
|
static java.lang.String |
SSL_TRUSTSTORE_RELOAD_INTERVAL_TPL_KEY |
|
static java.lang.String |
SSL_TRUSTSTORE_TYPE_TPL_KEY |
| Constructor | Description |
|---|---|
FileBasedKeyStoresFactory() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
destroy() |
Releases any resources being used.
|
Configuration |
getConf() |
Returns the configuration of the factory.
|
javax.net.ssl.KeyManager[] |
getKeyManagers() |
Returns the keymanagers for owned certificates.
|
javax.net.ssl.TrustManager[] |
getTrustManagers() |
Returns the trustmanagers for trusted certificates.
|
void |
init(SSLFactory.Mode mode) |
Initializes the keystores of the factory.
|
static java.lang.String |
resolvePropertyName(SSLFactory.Mode mode,
java.lang.String template) |
Resolves a property name to its client/server version if applicable.
|
void |
setConf(Configuration conf) |
Sets the configuration for the factory.
|
public static final java.lang.String SSL_MONITORING_THREAD_NAME
public static final java.lang.String SSL_STORES_RELOAD_INTERVAL_TPL_KEY
public static final java.lang.String SSL_KEYSTORE_LOCATION_TPL_KEY
public static final java.lang.String SSL_KEYSTORE_PASSWORD_TPL_KEY
public static final java.lang.String SSL_KEYSTORE_KEYPASSWORD_TPL_KEY
public static final java.lang.String SSL_KEYSTORE_TYPE_TPL_KEY
public static final java.lang.String SSL_TRUSTSTORE_RELOAD_INTERVAL_TPL_KEY
public static final java.lang.String SSL_TRUSTSTORE_LOCATION_TPL_KEY
public static final java.lang.String SSL_TRUSTSTORE_PASSWORD_TPL_KEY
public static final java.lang.String SSL_TRUSTSTORE_TYPE_TPL_KEY
public static final java.lang.String SSL_EXCLUDE_CIPHER_LIST
public static final java.lang.String DEFAULT_KEYSTORE_TYPE
public static final int DEFAULT_SSL_STORES_RELOAD_INTERVAL
@VisibleForTesting public static java.lang.String resolvePropertyName(SSLFactory.Mode mode, java.lang.String template)
NOTE: This method is public for testing purposes.
mode - client/server mode.template - property name template.public void setConf(Configuration conf)
setConf in interface Configurableconf - the configuration for the factory.public Configuration getConf()
getConf in interface Configurablepublic void init(SSLFactory.Mode mode) throws java.io.IOException, java.security.GeneralSecurityException
init in interface KeyStoresFactorymode - if the keystores are to be used in client or server mode.java.io.IOException - thrown if the keystores could not be initialized due
to an IO error.java.security.GeneralSecurityException - thrown if the keystores could not be
initialized due to a security error.public void destroy()
destroy in interface KeyStoresFactorypublic javax.net.ssl.KeyManager[] getKeyManagers()
getKeyManagers in interface KeyStoresFactorypublic javax.net.ssl.TrustManager[] getTrustManagers()
getTrustManagers in interface KeyStoresFactoryCopyright © 2008–2025 Apache Software Foundation. All rights reserved.