Class PersonalCertificateService
java.lang.Object
fr.gouv.vitam.security.internal.rest.service.SecurityService
fr.gouv.vitam.security.internal.rest.service.PersonalCertificateService
Manages personal certificates
-
Constructor Summary
ConstructorDescriptionPersonalCertificateService
(LogbookOperationsClientFactory logbookOperationsClientFactory, PersonalRepository personalRepository) -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkPersonalCertificateExistence
(byte[] certificate, String permission) Checks if the personal certificate if valid.void
createPersonalCertificateIfNotPresent
(byte[] certificate) Create certificate if not present in DB.void
deletePersonalCertificateIfPresent
(byte[] certificate) Delete certificate if present.Methods inherited from class fr.gouv.vitam.security.internal.rest.service.SecurityService
checkCertificates
-
Constructor Details
-
PersonalCertificateService
public PersonalCertificateService(LogbookOperationsClientFactory logbookOperationsClientFactory, PersonalRepository personalRepository)
-
-
Method Details
-
createPersonalCertificateIfNotPresent
public void createPersonalCertificateIfNotPresent(byte[] certificate) throws PersonalCertificateException, InvalidParseOperationException Create certificate if not present in DB.- Throws:
PersonalCertificateException
- thrown if certificate parse failInvalidParseOperationException
- thrown if creation fail
-
deletePersonalCertificateIfPresent
public void deletePersonalCertificateIfPresent(byte[] certificate) throws PersonalCertificateException Delete certificate if present.- Parameters:
certificate
- the certificate to delete- Throws:
PersonalCertificateException
- thrown if certificate parse fail
-
checkPersonalCertificateExistence
public void checkPersonalCertificateExistence(byte[] certificate, String permission) throws LogbookClientException, InvalidParseOperationException, PersonalCertificateException Checks if the personal certificate if valid.- Parameters:
certificate
- the certificate to checkpermission
- the permission for which access if checked (required for logbook logging)- Throws:
LogbookClientException
- thrown if logbook creation failInvalidParseOperationException
- thrown if logbook or certificate parse failPersonalCertificateException
- thrown if certificate parse fail
-
findAllPersonalCertificates
public List<PersonalCertificateModel> findAllPersonalCertificates() throws InvalidParseOperationException- Returns:
- list of identity models
- Throws:
InvalidParseOperationException
- thrown retrieving certificates fail
-
getRepository
-