pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1859384 - /pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/ShowSignature.java
Date Thu, 16 May 2019 15:40:22 GMT
Author: tilman
Date: Thu May 16 15:40:22 2019
New Revision: 1859384

URL: http://svn.apache.org/viewvc?rev=1859384&view=rev
Log:
PDFBOX-3017: first certificate isn't always the correct one, see file from https://github.com/veraPDF/veraPDF-library/issues/1026

Modified:
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/ShowSignature.java

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/ShowSignature.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/ShowSignature.java?rev=1859384&r1=1859383&r2=1859384&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/ShowSignature.java
(original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/ShowSignature.java
Thu May 16 15:40:22 2019
@@ -454,7 +454,9 @@ public final class ShowSignature
             // https://www.quovadisglobal.com/~/media/Files/Repository/QV_RCA1_RCA3_CPCPS_V4_11.ashx
             // also 021496.pdf and 036351.pdf from digitalcorpora
             validateTimestampToken(timeStampToken);
-            X509CertificateHolder tstCertHolder = (X509CertificateHolder) timeStampToken.getCertificates().getMatches(null).iterator().next();
+            Collection<X509CertificateHolder> tstMatches =
+                timeStampToken.getCertificates().getMatches(timeStampToken.getSID());
+            X509CertificateHolder tstCertHolder = tstMatches.iterator().next();
             X509Certificate certFromTimeStamp = new JcaX509CertificateConverter().getCertificate(tstCertHolder);
             // merge both stores using a set to remove duplicates
             HashSet<X509CertificateHolder> certificateHolderSet = new HashSet<>();



Mime
View raw message