Interface IKeyStoreEntityDao


public interface IKeyStoreEntityDao
DAO for reading and writing KeyStoreEntity entities.
Since:
8.5.0
Author:
XIMA Media GmbH
See Also:
  • Method Details

    • createCustomKeyStore

      @NotNull @NotNull KeyStoreEntity createCustomKeyStore(NewKeyStoreDefinition newKeyStoreDefinition) throws FcCertificateManagementException
      Creates a new custom keystore with the specified name, description, assignee type, and assignee ID.
      Parameters:
      newKeyStoreDefinition - the definition of the new keystore to be created, containing the name, description, and scope.
      Returns:
      the created KeyStoreEntity.
      Throws:
      IllegalArgumentException - if the provided name is blank, the provided keyStoreScope is invalid or the keystore scope is not supported, e.g., custom keystores are not supported for the USER scope.
      FcCertificateManagementException - if the keystore already exists for the specified name and/or scope or if the keystore cannot be created for any other reason.
    • delete

      Deletes the specified keystore entity.
      Parameters:
      entity - the keystore entity to delete.
      Throws:
      IllegalArgumentException - if the provided entity is null
      IllegalStateException - if the entity is not managed by the current context
      FcCertificateManagementException - if the keystore cannot be deleted
    • findById

      @NotNull @NotNull Optional<KeyStoreEntity> findById(Long id)
      Retrieves a KeyStoreEntity by its ID.
      Parameters:
      id - the ID of the keystore to retrieve.
      Returns:
      an Optional containing the KeyStoreEntity if found, or an empty Optional if not
    • findByName

      @NotNull @NotNull Optional<KeyStoreEntity> findByName(String name, KeyStoreScope scope)
      Retrieves a KeyStoreEntity by its name and scope.
      Parameters:
      name - the name of the keystore to retrieve.
      scope - the scope of the keystore to retrieve.
      Returns:
      an Optional containing the KeyStoreEntity if found, or an empty Optional if not
    • getAllByAssigneeType

      @NotNull @NotNull Set<KeyStoreEntity> getAllByAssigneeType(Set<EAssigneeType> assigneeTypes)
      Retrieves a list of all keystores assigned to the specified type of assignee.
      Parameters:
      assigneeTypes - the types of the assignee (e.g., user, group).
      Returns:
      a set of keystore entities containing information about the keystores assigned to the specified assignee if the user has permission to access them.
    • getAllByKeyStoreScopes

      @NotNull @NotNull Set<KeyStoreEntity> getAllByKeyStoreScopes(Set<KeyStoreScope> keyStoreScopes)
      Retrieves a set of all keystores for the given scopes.

      Note: If the default keystore for a given scope does not exist, it will be created automatically and returned with the list of keystores.

      Parameters:
      keyStoreScopes - the scopes of the keystores to retrieve.
      Returns:
      a set of the KeyStoreEntity objects for the specified scopes. This set contains all keystores for the specified scopes, including the default keystore if it exists or was created. If no scopes are provided, an empty set is returned.
      Throws:
      IllegalArgumentException - if any of the provided keyStoreScopes are invalid
      IllegalStateException - if a default keystore cannot be created for any reason
    • getDefaultKeyStore

      @NotNull @NotNull KeyStoreEntity getDefaultKeyStore(KeyStoreScope defaultScope)
      Retrieves the default keystore for the specified scope. If the default keystore does not exist, it will be created.

      Note: The default keystore is a special keystore that is automatically created for each scope. There can only be one default keystore per scope.

      Parameters:
      defaultScope - the scope for which to retrieve the default keystore.
      Returns:
      the default KeyStoreEntity for the specified scope.
      Throws:
      IllegalArgumentException - if the provided defaultScope is invalid.
      IllegalStateException - if the default keystore cannot be created for any other reason.