Interface KeyStorePersistenceManager
-
- All Known Implementing Classes:
HybridKeyStorePersistenceManager,JDBCKeyStorePersistenceManager,RegistryKeyStorePersistenceManager
public interface KeyStorePersistenceManagerThis interface supports the persistence/storage related logics of key stores.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddKeystore(KeyStoreModel keyStoreModel, int tenantId)Add the key store to the data storage.voiddeleteKeyStore(String keyStoreName, int tenantId)Delete the key store from the data storage.StringgetEncryptedKeyStorePassword(String keyStoreName, int tenantId)Get the password as a character array for the given key store name.StringgetEncryptedPrivateKeyPassword(String keyStoreName, int tenantId)Get the private key password as a character array for the given key store name.Optional<KeyStoreModel>getKeyStore(String keyStoreName, int tenantId)Get the key store from the data storage.DategetKeyStoreLastModifiedDate(String keyStoreName, int tenantId)Get the last modified date of the key store.booleanisKeyStoreExists(String keyStoreName, int tenantId)Check whether the given keystore exists or not.List<KeyStoreModel>listKeyStores(int tenantId)Method to retrieve list of keystore metadata of all the keystores in a tenant.voidupdateKeyStore(KeyStoreModel keyStoreModel, int tenantId)Update the key store in the data storage.
-
-
-
Method Detail
-
addKeystore
void addKeystore(KeyStoreModel keyStoreModel, int tenantId) throws SecurityException
Add the key store to the data storage.- Parameters:
keyStoreModel- Key store model.tenantId- Tenant Id.- Throws:
SecurityException- If an error occurs while adding the key store.
-
getKeyStore
Optional<KeyStoreModel> getKeyStore(String keyStoreName, int tenantId) throws SecurityException
Get the key store from the data storage.- Parameters:
keyStoreName- Name of the key store.tenantId- Tenant Id.- Returns:
- Key store model.
- Throws:
SecurityException- If an error occurs while getting the key store.
-
isKeyStoreExists
boolean isKeyStoreExists(String keyStoreName, int tenantId) throws SecurityException
Check whether the given keystore exists or not.- Parameters:
keyStoreName- Key store name.tenantId- Tenant ID.- Returns:
- whether the tenant primary keystore exists or not.
- Throws:
SecurityException- If an error occurs.
-
listKeyStores
List<KeyStoreModel> listKeyStores(int tenantId) throws SecurityException
Method to retrieve list of keystore metadata of all the keystores in a tenant.- Parameters:
tenantId- tenantId.- Returns:
- List of KeyStoreMetaData objects.
- Throws:
SecurityException- If an error occurs while retrieving the keystore data.
-
updateKeyStore
void updateKeyStore(KeyStoreModel keyStoreModel, int tenantId) throws SecurityException
Update the key store in the data storage.- Parameters:
keyStoreModel- Key store model.tenantId- Tenant Id.- Throws:
SecurityException
-
deleteKeyStore
void deleteKeyStore(String keyStoreName, int tenantId) throws SecurityException
Delete the key store from the data storage.- Parameters:
keyStoreName- Name of the key store.tenantId- Tenant Id.- Throws:
SecurityException- If an error occurs while deleting the key store.
-
getKeyStoreLastModifiedDate
Date getKeyStoreLastModifiedDate(String keyStoreName, int tenantId)
Get the last modified date of the key store.- Parameters:
keyStoreName- Key store name.- Returns:
- Last modified date of the key store.
-
getEncryptedKeyStorePassword
String getEncryptedKeyStorePassword(String keyStoreName, int tenantId) throws SecurityException
Get the password as a character array for the given key store name.- Parameters:
keyStoreName- key store name.tenantId- Tenant Id.- Returns:
- KeyStore Password as a character array.
- Throws:
SecurityException- If there is an error while getting the key store password.
-
getEncryptedPrivateKeyPassword
String getEncryptedPrivateKeyPassword(String keyStoreName, int tenantId) throws SecurityException
Get the private key password as a character array for the given key store name.- Parameters:
keyStoreName- Key store name.tenantId- Tenant Id.- Returns:
- Private key password as a character array.
- Throws:
SecurityException- If an error occurs while getting the private key password.
-
-