Package org.forgerock.audit.secure
Class JcaKeyStoreHandler
- java.lang.Object
-
- org.forgerock.audit.secure.JcaKeyStoreHandler
-
- All Implemented Interfaces:
KeyStoreHandler
public class JcaKeyStoreHandler extends Object implements KeyStoreHandler
Default implementation of a Keystore handler.
-
-
Constructor Summary
Constructors Constructor Description JcaKeyStoreHandler(String type, String location, String password)
Creates a new keystore handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getLocation()
Returns the path to the keystore.String
getPassword()
Returns the password.KeyStore
getStore()
Get the keystore.String
getType()
Returns the type of the keystore.void
setStore(KeyStore keystore)
Sets the keystore.void
store()
Saves the keystore.
-
-
-
Constructor Detail
-
JcaKeyStoreHandler
public JcaKeyStoreHandler(String type, String location, String password) throws Exception
Creates a new keystore handler.- Parameters:
type
- The type of keystorelocation
- The path of the keystorepassword
- The password to access the keystore- Throws:
Exception
- If an error occurs while initialising the keystore
-
-
Method Detail
-
getStore
public KeyStore getStore()
Description copied from interface:KeyStoreHandler
Get the keystore.- Specified by:
getStore
in interfaceKeyStoreHandler
- Returns:
- the keystore.
-
setStore
public void setStore(KeyStore keystore) throws Exception
Description copied from interface:KeyStoreHandler
Sets the keystore.- Specified by:
setStore
in interfaceKeyStoreHandler
- Parameters:
keystore
- The keystore to use- Throws:
Exception
- If an error occurs
-
store
public void store() throws Exception
Description copied from interface:KeyStoreHandler
Saves the keystore.- Specified by:
store
in interfaceKeyStoreHandler
- Throws:
Exception
- If an error occurs.
-
getPassword
public String getPassword()
Description copied from interface:KeyStoreHandler
Returns the password.- Specified by:
getPassword
in interfaceKeyStoreHandler
- Returns:
- the password used to access the keystore
-
getLocation
public String getLocation()
Description copied from interface:KeyStoreHandler
Returns the path to the keystore.- Specified by:
getLocation
in interfaceKeyStoreHandler
- Returns:
- the path
-
getType
public String getType()
Description copied from interface:KeyStoreHandler
Returns the type of the keystore.- Specified by:
getType
in interfaceKeyStoreHandler
- Returns:
- the keystore type
-
-