public class KeyStoreConfiguration extends Object
This class is usually de-serialized from json using Jackson. It is immutable once created.
Constructor and Description |
---|
KeyStoreConfiguration(String keyStorePasswordFile,
String keyPasswordFile,
String keyStoreType,
String keyStoreFile,
String providerClass,
String providerArg,
String providerName,
Map<String,Object> parameters)
Create an Immutable KeyStoreConfiguration that holds keystore configuration parameters.
|
Modifier and Type | Method and Description |
---|---|
char[] |
getKeyPassword(String pathPrefix)
Get the key password used to unlock individual key entries.The results in the
file being opened and read into memory.
|
String |
getKeyPasswordFile()
Get the path to file that holds the password to unlock individual keys.
|
String |
getKeyStoreFile()
Get the path to the keystore.
|
char[] |
getKeyStorePassword(String pathPrefix)
Get the keystore password.
|
String |
getKeyStorePasswordFile()
Get the path to the file that contains the password/pin used to unlock the keystore.
|
String |
getKeyStoreType()
Get the keystore type.
|
Map<String,Object> |
getParameters()
Get the optional parameter map used to initialize a keystore.
|
String |
getProviderArg()
Get the provider generic argument as a string.
|
String |
getProviderClass()
Get the provider class name string.
|
String |
getProviderName()
The provider string name (LDAP, JKS, etc.).
|
KeyStore |
loadKeyStore(String pathPrefix)
Initialize and load the keystore described by this configuration
There are a number of possible exceptions that can be generated - they are consolidated
to a single KeyStoreException and the underlying exception is wrapped.
|
KeyStore |
loadKeyStore(String pathPrefix,
ClassLoader classLoader)
Initialize and load the keystore described by this configuration
There are a number of possible exceptions that can be generated - they are consolidated
to a single KeyStoreException and the underlying exception is wrapped.
|
public KeyStoreConfiguration(String keyStorePasswordFile, String keyPasswordFile, String keyStoreType, String keyStoreFile, String providerClass, String providerArg, String providerName, Map<String,Object> parameters)
Creating instances via json de-serialization is the recommended approach.
keyStorePasswordFile
- path name of the .storepass filekeyPasswordFile
- path name of the .keypass filekeyStoreType
- The type of keystore (JKS, JCEKS, etc.)keyStoreFile
- The path name of the keystore file ( keystore.jceks)providerClass
- The name of the KeyStoreProvider class (org.acme.CustomKeystoreProvider)providerArg
- Optional argument used to instantiate a KeyStoreProvider. The interpretation
is left to the providerproviderName
- The name of the registered keystore provider instance ("LDAP", "JKS", etc.)parameters
- optional key/value map used to create loadstore parameters for keystore
initializationpublic String getProviderName()
public String getKeyStorePasswordFile()
public String getKeyPasswordFile()
public String getKeyStoreType()
public String getKeyStoreFile()
public String getProviderClass()
public String getProviderArg()
public Map<String,Object> getParameters()
public char[] getKeyStorePassword(String pathPrefix) throws IOException
pathPrefix
- The path prefix where files will be opened relative to. This can be null or ""
in which case the current directory is assumed. This will not be applied
to any files that start with a file separator.IOException
- IF the keystore password file can not be openedpublic char[] getKeyPassword(String pathPrefix) throws IOException
pathPrefix
- The path prefix where files will be opened relative to. This can be null or ""
in which case the current directory is assumed. This will not be applied
to any files that start with a file separator.IOException
- If the key password file can not be openedpublic KeyStore loadKeyStore(String pathPrefix) throws KeyStoreException
pathPrefix
- The path prefix where files will be opened relative to. This can be null or ""
in which case the current directory is assumed. This will not be applied
to any files that start with a file separator.KeyStoreException
- if the keystore can not be opened or initialized.public KeyStore loadKeyStore(String pathPrefix, ClassLoader classLoader) throws KeyStoreException
pathPrefix
- The path prefix where files will be opened relative to. This can be null or ""
in which case the current directory is assumed. This will not be applied
to any files that start with a file separator.classLoader
- The classloader to use for dynamic classloading of the KeyStore ProviderKeyStoreException
- if the keystore can not be opened or initialized.Copyright © 2010-2018, ForgeRock All Rights Reserved.