pdfbox-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=1859386&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/branches/issue45/examples/src/main/java/org/apache/pdfbox/examples/signature/ShowSignature.java

Modified: pdfbox/branches/issue45/examples/src/main/java/org/apache/pdfbox/examples/signature/ShowSignature.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue45/examples/src/main/java/org/apache/pdfbox/examples/signature/ShowSignature.java?rev=1859386&r1=1859385&r2=1859386&view=diff
==============================================================================
--- pdfbox/branches/issue45/examples/src/main/java/org/apache/pdfbox/examples/signature/ShowSignature.java
(original)
+++ pdfbox/branches/issue45/examples/src/main/java/org/apache/pdfbox/examples/signature/ShowSignature.java
Thu May 16 15:40:30 2019
@@ -441,7 +441,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<X509CertificateHolder>();



Mime
View raw message