java.lang.Object
org.elasticsearch.common.ssl.StoreKeyConfig
- All Implemented Interfaces:
SslKeyConfig
A
SslKeyConfig that builds a Key Manager from a keystore file.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate aSslTrustConfigbased on the underlying file store that backs this key configbooleangetKeys()Equivalent togetKeys(false).getKeys(boolean filterKeystore) Return the list of keys inside the configured keystore, optionally applying thefilterthat was set during construction.inthashCode()booleantoString()
-
Constructor Details
-
StoreKeyConfig
public StoreKeyConfig(String path, char[] storePassword, String type, @Nullable Function<KeyStore, KeyStore> filter, char[] keyPassword, String algorithm, Path configBasePath) - Parameters:
path- The path to the keystore filestorePassword- The password for the keystoretype- Thetypeof the keystore (typically "PKCS12" or "jks"). SeeKeyStoreUtil.inferKeyStoreType(java.lang.String).filter- A function to process the keystore after it is loaded. SeeKeyStoreUtil.filter(java.security.KeyStore, java.util.function.Predicate<org.elasticsearch.common.ssl.KeyStoreUtil.KeyStoreEntry>)keyPassword- The password for the key(s) within the keystore (seeKeyManagerFactory.init(KeyStore, char[])).algorithm- The algorithm to use for the Key Manager (seeKeyManagerFactory.getAlgorithm()).configBasePath- The base path for configuration files (used for error handling)
-
-
Method Details
-
asTrustConfig
Description copied from interface:SslKeyConfigCreate aSslTrustConfigbased on the underlying file store that backs this key config- Specified by:
asTrustConfigin interfaceSslKeyConfig
-
getDependentFiles
- Specified by:
getDependentFilesin interfaceSslKeyConfig- Returns:
- A collection of files that are read by this config object.
The
SslKeyConfig.createKeyManager()method will read these files dynamically, so the behaviour of this key config may change whenever any of these files are modified.
-
hasKeyMaterial
public boolean hasKeyMaterial()- Specified by:
hasKeyMaterialin interfaceSslKeyConfig
-
getKeys
Equivalent togetKeys(false).- Specified by:
getKeysin interfaceSslKeyConfig- Returns:
- A list of private keys and their associated certificates
-
getKeys
Return the list of keys inside the configured keystore, optionally applying thefilterthat was set during construction. -
getConfiguredCertificates
- Specified by:
getConfiguredCertificatesin interfaceSslKeyConfig- Returns:
- A collection of
certificatesused by this config.
-
createKeyManager
- Specified by:
createKeyManagerin interfaceSslKeyConfig- Returns:
- A new
X509ExtendedKeyManager.
-
toString
-
equals
-
hashCode
public int hashCode()
-