pdfbox-commits mailing list archives

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

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

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

Modified: pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/ShowSignature.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/ShowSignature.java?rev=1860816&r1=1860815&r2=1860816&view=diff
==============================================================================
--- pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/ShowSignature.java
(original)
+++ pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/ShowSignature.java
Sat Jun  8 08:46:30 2019
@@ -235,9 +235,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());
                                 }
                             }
                         }
@@ -444,8 +444,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
@@ -582,8 +583,9 @@ public final class ShowSignature
             throws IOException, CertificateException, TSPException, OperatorCreationException
     {
         // 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