Package fr.gouv.vitam.security.internal.rest.service

# 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

  Modifier and Type
  Method
  Description
  `void`
  `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.
  `List<PersonalCertificateModel>`
  `findAllPersonalCertificates()`
  `CertificateRepository`
  `getRepository()`

  ### Methods inherited from class fr.gouv.vitam.security.internal.rest.service.SecurityService

  `checkCertificates`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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 fail
      `InvalidParseOperationException` - 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 check
      `permission` - the permission for which access if checked (required for logbook logging)
    Throws:
      `LogbookClientException` - thrown if logbook creation fail
      `InvalidParseOperationException` - thrown if logbook or certificate parse fail
      `PersonalCertificateException` - thrown if certificate parse fail

  - ### findAllPersonalCertificates

    public List<PersonalCertificateModel> findAllPersonalCertificates() throws InvalidParseOperationException
    Returns:
      list of identity models
    Throws:
      `InvalidParseOperationException` - thrown retrieving certificates fail

  - ### getRepository

    public CertificateRepository getRepository()