Class ValidatorChainBuilder

java.lang.Object
com.itextpdf.signatures.validation.ValidatorChainBuilder

public class ValidatorChainBuilder extends Object
A builder class to construct all necessary parts of a validation chain. The builder can be reused to create multiple instances of a validator.
  • Constructor Details

    • ValidatorChainBuilder

      public ValidatorChainBuilder()
  • Method Details

    • buildSignatureValidator

      public SignatureValidator buildSignatureValidator (PdfDocument document)
      Create a new SignatureValidator instance with the current configuration. This method can be used to create multiple validators.
      Parameters:
      document - PdfDocument instance which will be validated
      Returns:
      a new instance of a signature validator.
    • buildDocumentRevisionsValidator

      public DocumentRevisionsValidator buildDocumentRevisionsValidator()
      Create a bew DocumentRevisionsValidator instance with the current configuration. This method can be used to create multiple validators.
      Returns:
      a new instance of a document revisions validator.
    • buildCertificateChainValidator

      public CertificateChainValidator buildCertificateChainValidator()
      Create a new CertificateChainValidator instance. This method can be used to create multiple validators.
      Returns:
      a new instance of a CertificateChainValidator.
    • buildRevocationDataValidator

      public RevocationDataValidator buildRevocationDataValidator()
      Create a new RevocationDataValidator instance This method can be used to create multiple validators.
      Returns:
      a new instance of a RevocationDataValidator.
    • buildOCSPValidator

      public OCSPValidator buildOCSPValidator()
      Create a new OCSPValidator instance. This method can be used to create multiple validators.
      Returns:
      a new instance of a OCSPValidator.
    • buildCRLValidator

      public CRLValidator buildCRLValidator()
      Create a new CRLValidator instance. This method can be used to create multiple validators.
      Returns:
      a new instance of a CRLValidator.
    • withDocumentRevisionsValidatorFactory

      public ValidatorChainBuilder withDocumentRevisionsValidatorFactory (Supplier<DocumentRevisionsValidator> documentRevisionsValidatorFactory)
      Use this factory method to create instances of DocumentRevisionsValidator for use in the validation chain.
      Parameters:
      documentRevisionsValidatorFactory - the document revisions validator factory method to use
      Returns:
      the current ValidatorChainBuilder.
    • withCRLValidatorFactory

      public ValidatorChainBuilder withCRLValidatorFactory (Supplier<CRLValidator> crlValidatorFactory)
      Use this factory method to create instances of CRLValidator for use in the validation chain.
      Parameters:
      crlValidatorFactory - the CRLValidatorFactory method to use
      Returns:
      the current ValidatorChainBuilder.
    • withOCSPValidatorFactory

      public ValidatorChainBuilder withOCSPValidatorFactory (Supplier<OCSPValidator> ocspValidatorFactory)
      Use this factory method to create instances of OCSPValidator for use in the validation chain.
      Parameters:
      ocspValidatorFactory - the OCSPValidatorFactory method to use
      Returns:
      the current ValidatorChainBuilder.
    • withRevocationDataValidatorFactory

      public ValidatorChainBuilder withRevocationDataValidatorFactory (Supplier<RevocationDataValidator> revocationDataValidatorFactory)
      Use this factory method to create instances of RevocationDataValidator for use in the validation chain.
      Parameters:
      revocationDataValidatorFactory - the RevocationDataValidator factory method to use
      Returns:
      the current ValidatorChainBuilder.
    • withCertificateChainValidatorFactory

      public ValidatorChainBuilder withCertificateChainValidatorFactory (Supplier<CertificateChainValidator> certificateChainValidatorFactory)
      Use this factory method to create instances of CertificateChainValidator for use in the validation chain.
      Parameters:
      certificateChainValidatorFactory - the CertificateChainValidator factory method to use
      Returns:
      the current ValidatorChainBuilder.
    • withSignatureValidationProperties

      public ValidatorChainBuilder withSignatureValidationProperties (SignatureValidationProperties properties)
      Use this instance of a SignatureValidationProperties in the validation chain.
      Parameters:
      properties - the SignatureValidationProperties instance to use
      Returns:
      the current ValidatorChainBuilder.
    • withIssuingCertificateRetrieverFactory

      public ValidatorChainBuilder withIssuingCertificateRetrieverFactory (Supplier<IssuingCertificateRetriever> certificateRetrieverFactory)
      Use this factory method to create instances of IssuingCertificateRetriever for use in the validation chain.
      Parameters:
      certificateRetrieverFactory - the IssuingCertificateRetriever factory method to use
      Returns:
      the current ValidatorChainBuilder.
    • withKnownCertificates

      public ValidatorChainBuilder withKnownCertificates (Collection<Certificate> knownCertificates)
      Adds known certificates to the IssuingCertificateRetriever.
      Parameters:
      knownCertificates - the list of known certificates to add
      Returns:
      the current ValidatorChainBuilder.
    • withTrustedCertificates

      public ValidatorChainBuilder withTrustedCertificates (Collection<Certificate> trustedCertificates)
      Sets the trusted certificates to the IssuingCertificateRetriever.
      Parameters:
      trustedCertificates - the list of trusted certificates to set
      Returns:
      the current ValidatorChainBuilder.
    • getCertificateRetriever

      public IssuingCertificateRetriever getCertificateRetriever()
      Retrieves the explicitly added or automatically created IssuingCertificateRetriever instance.
      Returns:
      the explicitly added or automatically created IssuingCertificateRetriever instance.
    • getProperties

      public SignatureValidationProperties getProperties()
      Retrieves the explicitly added or automatically created SignatureValidationProperties instance.
      Returns:
      the explicitly added or automatically created SignatureValidationProperties instance.