Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-5157

allow to make timestamp only signature "LTV"

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.23, 3.0.0 PDFBox
    • Fix Version/s: 2.0.24, 3.0.0 PDFBox
    • Component/s: Signing
    • Labels:
      None

      Description

      To make TestCreateSignature.testCreateSignedTimeStamp()  timestamp.pdf (ETSI.RFC3161) conformant with LTV, I had to enhance AddValidationInformation :

       

      ### Eclipse Workspace Patch 1.0
      #P pdfbox
      Index: examples/src/main/java/org/apache/pdfbox/examples/signature/validation/AddValidationInformation.java
      ===================================================================
      --- examples/src/main/java/org/apache/pdfbox/examples/signature/validation/AddValidationInformation.java (revision 1885032)
      +++ examples/src/main/java/org/apache/pdfbox/examples/signature/validation/AddValidationInformation.java (working copy)
      @@ -30,6 +30,7 @@
       import java.security.cert.X509CRL;
       import java.security.cert.X509Certificate;
       import java.util.Calendar;
      +import java.util.Date;
       import java.util.HashSet;
       import java.util.Set;
       
      @@ -355,9 +356,15 @@
       // This certificate has been OCSP-checked before
       return;
       }
      - OcspHelper ocspHelper = new OcspHelper(
      + Date time = null;
      + if (null == signDate) {
      + time = new Date(); //should rather take timestampTime
      + } else {
      + time = signDate.getTime();
      + }
      + OcspHelper ocspHelper = new OcspHelper(
       certInfo.getCertificate(),
      - signDate.getTime(),
      + time,
       certInfo.getIssuerCertificate(),
       new HashSet<>(certInformationHelper.getCertificateSet()),
       certInfo.getOcspUrl());
      

        Attachments

        1. timestamped_PDFBOX-5157.pdf
          37 kB
          Ralf Hauser

          Activity

            People

            • Assignee:
              tilman Tilman Hausherr
              Reporter:
              hauser@acm.org Ralf Hauser
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: