Class LotlTrustedStore

java.lang.Object
com.itextpdf.signatures.validation.lotl.LotlTrustedStore

public class LotlTrustedStore extends Object
Trusted certificates storage class for country specific Lotl trusted certificates.
  • Constructor Details

  • Method Details

    • getCertificates

      public Set<Certificate> getCertificates()
      Gets all the certificates stored in this trusted store.
      Returns:
      Certificate stored
    • setPreviousCertificates

      public LotlTrustedStore setPreviousCertificates (List<X509Certificate> previousCertificates)
      Sets the certificate chain, corresponding to the certificate we are about to check.
      Parameters:
      previousCertificates - list of X509Certificate certificates
      Returns:
      same instance of LotlTrustedStore
    • checkIfCertIsTrusted

      public boolean checkIfCertIsTrusted (ValidationReport result, ValidationContext context, X509Certificate certificate, Date validationDate)
      Checks if given certificate is trusted according to context and time in which it is used.
      Parameters:
      result - ValidationReport which stores check results
      context - ValidationContext in which certificate is used
      certificate - X509Certificate certificate to be checked
      validationDate - Date date time in which certificate is validated
      Returns:
      true if certificate is trusted, false otherwise
    • getLotlValidationReport

      public ValidationReport getLotlValidationReport()
      Gets lotl validation report.
      Returns:
      validation report regarding trusted lists accessibility.
    • getCertificateSourceBasedOnServiceType

      protected Set<CertificateSource> getCertificateSourceBasedOnServiceType (String serviceType)
      Gets set of CertificateSource items based on service type identifier of a given certificate in LOTL file.

      Certificate source defines in which context this certificate is supposed to be trusted.

      Parameters:
      serviceType - String representing service type identifier field in LOTL file.
      Returns:
      set of CertificateSource representing contexts, in which certificate is supposed to be trusted.
    • isScopeCorrectlySpecified

      protected boolean isScopeCorrectlySpecified (List<ReportItem> reportItems, X509Certificate certificate, List<AdditionalServiceInformationExtension> extensions)
      Checks if scope specified by extensions contains valid types.
      Parameters:
      reportItems - ValidationReport which is populated with detailed validation results
      certificate - X509Certificate to be validated
      extensions - AdditionalServiceInformationExtension that specify scope
      Returns:
      false if extensions specify scope only with invalid types.