Class CertInformationCollector

java.lang.Object
org.apache.pdfbox.examples.signature.validation.CertInformationCollector

public class CertInformationCollector extends Object
This class helps to extract data/information from a signature. The information is held in CertSignatureInformation. Some information is needed for validation processing of the participating certificates.
Author:
Alexis Suter
  • Constructor Details

    • CertInformationCollector

      public CertInformationCollector()
  • Method Details

    • getLastCertInfo

      public CertInformationCollector.CertSignatureInformation getLastCertInfo(org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature signature, String fileName) throws CertificateProccessingException, IOException
      Gets the certificate information of a signature.
      Parameters:
      signature - the signature of the document.
      fileName - of the document.
      Returns:
      the CertSignatureInformation containing all certificate information
      Throws:
      CertificateProccessingException - when there is an error processing the certificates
      IOException - on a data processing error
    • addAllCertsFromHolders

      public void addAllCertsFromHolders(org.bouncycastle.cert.X509CertificateHolder[] certHolders) throws CertificateProccessingException
      Gets a list of X509Certificate out of an array of X509CertificateHolder. The certificates will be added to certificateSet.
      Parameters:
      certHolders - Array of X509CertificateHolder
      Throws:
      CertificateProccessingException - when one of the Certificates could not be parsed.
    • getCertificateSet

      public Set<X509Certificate> getCertificateSet()
      Get the set of all processed certificates until now.
      Returns:
      a set of serial numbers to certificates.