Interface KeyStorePersistenceManager

All Known Implementing Classes:
HybridKeyStorePersistenceManager, JDBCKeyStorePersistenceManager, RegistryKeyStorePersistenceManager

public interface KeyStorePersistenceManager
This interface supports the persistence/storage related logics of key stores.
  • Method Details

    • 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.