You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Ralf Hauser (Jira)" <ji...@apache.org> on 2021/04/08 02:24:00 UTC
[jira] [Created] (PDFBOX-5157) allow to make timestamp only
signature "LTV"
Ralf Hauser created PDFBOX-5157:
-----------------------------------
Summary: allow to make timestamp only signature "LTV"
Key: PDFBOX-5157
URL: https://issues.apache.org/jira/browse/PDFBOX-5157
Project: PDFBox
Issue Type: Bug
Affects Versions: 3.0.0 PDFBox
Reporter: Ralf Hauser
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());
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org