Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0.23, 3.0.0 PDFBox
-
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());