pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1860815 - /pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/ShowSignature.java
Date Sat, 08 Jun 2019 08:46:25 GMT
Author: tilman
Date: Sat Jun  8 08:46:24 2019
New Revision: 1860815

URL: http://svn.apache.org/viewvc?rev=1860815&view=rev
Log:
PDFBOX-4071: add cast / type; avoid "unchecked" warnings

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=1860815&r1=1860814&r2=1860815&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
Sat Jun  8 08:46:24 2019
@@ -243,9 +243,9 @@ public final class ShowSignature
 
                                     if (sig.getSignDate() != null)
                                     {
-                                        verifyCertificateChain(new JcaCertStore(certs),
-                                                cert,
-                                                sig.getSignDate().getTime());
+                                        @SuppressWarnings("unchecked")
+                                        Store<X509CertificateHolder> store = new JcaCertStore(certs);
+                                        verifyCertificateChain(store, cert, sig.getSignDate().getTime());
                                     }
                                 }
                                 break;
@@ -457,8 +457,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);
+            @SuppressWarnings("unchecked") // TimeStampToken.getSID() is untyped
             Collection<X509CertificateHolder> tstMatches =
-                timeStampToken.getCertificates().getMatches(timeStampToken.getSID());
+                timeStampToken.getCertificates().getMatches((Selector<X509CertificateHolder>)
timeStampToken.getSID());
             X509CertificateHolder tstCertHolder = tstMatches.iterator().next();
             X509Certificate certFromTimeStamp = new JcaX509CertificateConverter().getCertificate(tstCertHolder);
             // merge both stores using a set to remove duplicates
@@ -595,8 +596,9 @@ public final class ShowSignature
             throws TSPException, CertificateException, OperatorCreationException, IOException
     {
         // https://stackoverflow.com/questions/42114742/
+        @SuppressWarnings("unchecked") // TimeStampToken.getSID() is untyped
         Collection<X509CertificateHolder> tstMatches =
-                timeStampToken.getCertificates().getMatches(timeStampToken.getSID());
+                timeStampToken.getCertificates().getMatches((Selector<X509CertificateHolder>)
timeStampToken.getSID());
         X509CertificateHolder holder = tstMatches.iterator().next();
         X509Certificate tstCert = new JcaX509CertificateConverter().getCertificate(holder);
         SignerInformationVerifier siv = new JcaSimpleSignerInfoVerifierBuilder().setProvider(SecurityProvider.getProvider()).build(tstCert);



Mime
View raw message