Class JDBCKeyStorePersistenceManager
java.lang.Object
org.wso2.carbon.keystore.persistence.impl.JDBCKeyStorePersistenceManager
- All Implemented Interfaces:
KeyStorePersistenceManager
This implementation handles the keystore storage/persistence related logics in the Database.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddKeystore(KeyStoreModel keyStore, int tenantId) Add the key store to the data storage.voiddeleteKeyStore(String keyStoreName, int tenantId) Delete the key store from the data storage.getEncryptedKeyStorePassword(String keyStoreName, int tenantId) Get the password as a character array for the given key store name.getEncryptedPrivateKeyPassword(String keyStoreName, int tenantId) Get the private key password as a character array for the given key store name.getKeyStore(String keyStoreName, int tenantId) Get the key store from the data storage.getKeyStoreLastModifiedDate(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.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.
-
Constructor Details
-
JDBCKeyStorePersistenceManager
public JDBCKeyStorePersistenceManager()
-
-
Method Details
-
addKeystore
Description copied from interface:KeyStorePersistenceManagerAdd the key store to the data storage.- Specified by:
addKeystorein interfaceKeyStorePersistenceManager- Parameters:
keyStore- Key store model.tenantId- Tenant Id.- Throws:
SecurityException- If an error occurs while adding the key store.
-
getKeyStore
public Optional<KeyStoreModel> getKeyStore(String keyStoreName, int tenantId) throws SecurityException Description copied from interface:KeyStorePersistenceManagerGet the key store from the data storage.- Specified by:
getKeyStorein interfaceKeyStorePersistenceManager- 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
Description copied from interface:KeyStorePersistenceManagerCheck whether the given keystore exists or not.- Specified by:
isKeyStoreExistsin interfaceKeyStorePersistenceManager- Parameters:
keyStoreName- Key store name.tenantId- Tenant ID.- Returns:
- whether the tenant primary keystore exists or not.
- Throws:
SecurityException- If an error occurs.
-
listKeyStores
Description copied from interface:KeyStorePersistenceManagerMethod to retrieve list of keystore metadata of all the keystores in a tenant.- Specified by:
listKeyStoresin interfaceKeyStorePersistenceManager- Parameters:
tenantId- tenantId.- Returns:
- List of KeyStoreMetaData objects.
- Throws:
SecurityException- If an error occurs while retrieving the keystore data.
-
updateKeyStore
Description copied from interface:KeyStorePersistenceManagerUpdate the key store in the data storage.- Specified by:
updateKeyStorein interfaceKeyStorePersistenceManager- Parameters:
keyStoreModel- Key store model.tenantId- Tenant Id.- Throws:
SecurityException
-
deleteKeyStore
Description copied from interface:KeyStorePersistenceManagerDelete the key store from the data storage.- Specified by:
deleteKeyStorein interfaceKeyStorePersistenceManager- Parameters:
keyStoreName- Name of the key store.tenantId- Tenant Id.- Throws:
SecurityException- If an error occurs while deleting the key store.
-
getKeyStoreLastModifiedDate
Description copied from interface:KeyStorePersistenceManagerGet the last modified date of the key store.- Specified by:
getKeyStoreLastModifiedDatein interfaceKeyStorePersistenceManager- Parameters:
keyStoreName- Key store name.- Returns:
- Last modified date of the key store.
-
getEncryptedKeyStorePassword
public String getEncryptedKeyStorePassword(String keyStoreName, int tenantId) throws SecurityException Description copied from interface:KeyStorePersistenceManagerGet the password as a character array for the given key store name.- Specified by:
getEncryptedKeyStorePasswordin interfaceKeyStorePersistenceManager- 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
public String getEncryptedPrivateKeyPassword(String keyStoreName, int tenantId) throws SecurityException Description copied from interface:KeyStorePersistenceManagerGet the private key password as a character array for the given key store name.- Specified by:
getEncryptedPrivateKeyPasswordin interfaceKeyStorePersistenceManager- 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.
-