Interface RpcKeyStoreManagementService
- All Superinterfaces:
RpcHandler, Serializable
Interface that defines the operations for managing keystores within the XIMA formcycle certificate module. This
service provides methods for creating, updating, deleting, and exporting keystores, as well as retrieving information
about certificates stored in a keystore.
-
Method Summary
Modifier and TypeMethodDescription@NotNull KeyStoreInfoDTOcreateCustomKeyStore(NewKeyStoreDefinition newKeyStoreDefinition, CertificateManagementUser user) Creates a new custom keystore with the specified name, description, assignee type, and assignee ID.voiddeleteKeyStore(Long keyStoreId, CertificateManagementUser user) Deletes the keystore with the specified ID.byte[]exportKeyStore(Long keyStoreId, char[] password, CertificateManagementUser user) Exports the keystore with the specified IDfindById(Long keyStoreId, CertificateManagementUser user) Retrieves the keystore with the specified ID.findByName(String name, KeyStoreScope scope, CertificateManagementUser user) Retrieves the keystore with the specified name in the given scope if it exists.@NotNull KeyStoreInfoDTOfindByUserId(Long userId, CertificateManagementUser user) Retrieves the keystore of the user with the specified ID.@NotNull Set<KeyStoreInfoDTO> getAllByAssigneeType(Set<EAssigneeType> assigneeTypes, CertificateManagementUser user) Retrieves a list of all keystores assigned to the specified type of assignee.@NotNull Set<KeyStoreInfoDTO> getAllByKeyStoreScopes(Set<KeyStoreScope> keyStoreScopes, CertificateManagementUser user) Retrieves a list of all keystores for the given scopes.@NotNull KeyStoreInfoDTOgetDefaultKeyStore(KeyStoreScope defaultScope, CertificateManagementUser user) Retrieves the default keystore for the specified scope.getKeyStoreListing(Long keyStoreId, CertificateManagementUser user) Retrieves a list of certificates stored in the specified keystore.
-
Method Details
-
createCustomKeyStore
@NotNull @NotNull KeyStoreInfoDTO createCustomKeyStore(NewKeyStoreDefinition newKeyStoreDefinition, CertificateManagementUser user) 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.user- the user who is creating the keystore.- Returns:
- a
KeyStoreInfoDTOobject containing information about the created keystore. - Throws:
IllegalArgumentException- if the provided name is blank or the provided keyStoreScope is invalid.FcCertificateManagementException- if the keystore already exists for the specified name and/or scope or if the user does not have permission to create it.
-
deleteKeyStore
void deleteKeyStore(Long keyStoreId, CertificateManagementUser user) throws FcCertificateManagementException Deletes the keystore with the specified ID.- Parameters:
keyStoreId- the ID of the keystore to delete.user- the user who is deleting the keystore.- Throws:
FcCertificateManagementException- if the keystore does not exist, cannot be deleted, or if the user does not have permission to delete it.
-
exportKeyStore
byte[] exportKeyStore(Long keyStoreId, char[] password, CertificateManagementUser user) throws FcCertificateManagementException, IOException Exports the keystore with the specified ID- Parameters:
keyStoreId- the ID of the keystore to export.password- the password to use for the keystore.user- the user who is exporting the keystore.- Returns:
- a byte array containing the exported keystore data.
- Throws:
FcCertificateManagementException- if the keystore does not exist, cannot be exported, or if the user does not have permission to export it.IOException
-
findById
Optional<KeyStoreInfoDTO> findById(Long keyStoreId, CertificateManagementUser user) throws FcCertificateManagementException Retrieves the keystore with the specified ID.- Parameters:
keyStoreId- the ID of the keystore to retrieve.user- the user who is requesting the keystore.- Returns:
- an
Optionalcontaining theKeyStoreInfoDTOobject with the specified ID. - Throws:
FcCertificateManagementException- if the user does not have permission to access the keystore.
-
findByName
Optional<KeyStoreInfoDTO> findByName(String name, KeyStoreScope scope, CertificateManagementUser user) throws FcCertificateManagementException Retrieves the keystore with the specified name in the given scope if it exists.- Parameters:
name- the name of the keystore to retrieve.scope- the scope of the keystore to retrieve.user- the user who is requesting the keystore.- Returns:
- an
Optionalcontaining theKeyStoreInfoDTOobject with the specified name and scope if it exists. - Throws:
FcCertificateManagementException- if the user does not have permission to access the keystore.
-
findByUserId
@NotNull @NotNull KeyStoreInfoDTO findByUserId(Long userId, CertificateManagementUser user) throws FcCertificateManagementException Retrieves the keystore of the user with the specified ID. There can only be one keystore per user, the default keystore. If the keystore does not exist, it will be created automatically.- Parameters:
userId- the ID of the user the keystore is assigned to.user- the user who is requesting the keystore.- Returns:
- a
KeyStoreInfoDTOobject containing information about the keystore. - Throws:
FcCertificateManagementException- if the user does not have permission to access the keystore.
-
getAllByAssigneeType
@NotNull @NotNull Set<KeyStoreInfoDTO> getAllByAssigneeType(Set<EAssigneeType> assigneeTypes, CertificateManagementUser user) throws FcCertificateManagementException Retrieves a list of all keystores assigned to the specified type of assignee.- Parameters:
assigneeTypes- the types of the assignee (e.g., user, group).user- the user who is requesting the keystores.- Returns:
- a set of
KeyStoreInfoDTOobjects containing information about the keystores assigned to the specified assignee if the user has permission to access them. - Throws:
FcCertificateManagementException- if an error occurs while retrieving the keystores.
-
getAllByKeyStoreScopes
@NotNull @NotNull Set<KeyStoreInfoDTO> getAllByKeyStoreScopes(Set<KeyStoreScope> keyStoreScopes, CertificateManagementUser user) throws FcCertificateManagementException Retrieves a list 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.user- the user who is requesting the keystores.- Returns:
- a set of
KeyStoreInfoDTOobjects containing information about the keystores for the specified scopes if the user has permission to access them. - Throws:
IllegalArgumentException- if any of the provided keyStoreScopes are invalidFcCertificateManagementException- if an error occurs while retrieving the keystores.
-
getDefaultKeyStore
@NotNull @NotNull KeyStoreInfoDTO getDefaultKeyStore(KeyStoreScope defaultScope, CertificateManagementUser user) throws FcCertificateManagementException 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.user- the user who is requesting the default keystore.- Returns:
- a
KeyStoreInfoDTOobject containing information about the default keystore. - Throws:
IllegalArgumentException- if the provided defaultScope is invalid.FcCertificateManagementException- if the user does not have permission to access the keystore.
-
getKeyStoreListing
Set<CertificateInfoDTO> getKeyStoreListing(Long keyStoreId, CertificateManagementUser user) throws FcCertificateManagementException Retrieves a list of certificates stored in the specified keystore.- Parameters:
keyStoreId- the ID of the keystore.user- the user who is requesting the certificate listing.- Returns:
- a set of
CertificateInfoDTOobjects containing information about the certificates in the keystore if the user has permission to access them. - Throws:
FcCertificateManagementException
-