Class PersonalCertificateService
- java.lang.Object
-
- fr.gouv.vitam.security.internal.rest.service.SecurityService
-
- fr.gouv.vitam.security.internal.rest.service.PersonalCertificateService
-
public class PersonalCertificateService extends SecurityService
Manages personal certificates
-
-
Constructor Summary
Constructors Constructor Description PersonalCertificateService(LogbookOperationsClientFactory logbookOperationsClientFactory, PersonalRepository personalRepository)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkPersonalCertificateExistence(byte[] certificate, java.lang.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.java.util.List<PersonalCertificateModel>
findAllPersonalCertificates()
CertificateRepository
getRepository()
-
Methods inherited from class fr.gouv.vitam.security.internal.rest.service.SecurityService
checkCertificates
-
-
-
-
Constructor Detail
-
PersonalCertificateService
public PersonalCertificateService(LogbookOperationsClientFactory logbookOperationsClientFactory, PersonalRepository personalRepository)
-
-
Method Detail
-
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, java.lang.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 java.util.List<PersonalCertificateModel> findAllPersonalCertificates() throws InvalidParseOperationException
- Returns:
- list of identity models
- Throws:
InvalidParseOperationException
- thrown retrieving certificates fail
-
getRepository
public CertificateRepository getRepository()
-
-