pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1835658 - in /pdfbox/branches/2.0/examples/src: main/java/org/apache/pdfbox/examples/signature/ main/java/org/apache/pdfbox/examples/signature/validation/ test/java/org/apache/pdfbox/examples/pdmodel/
Date Wed, 11 Jul 2018 18:03:26 GMT
Author: tilman
Date: Wed Jul 11 18:03:26 2018
New Revision: 1835658

URL: http://svn.apache.org/viewvc?rev=1835658&view=rev
Log:
PDFBOX-4071: add cast / type

Modified:
    pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/ShowSignature.java
    pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationCollector.java
    pdfbox/branches/2.0/examples/src/test/java/org/apache/pdfbox/examples/pdmodel/TestCreateSignature.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=1835658&r1=1835657&r2=1835658&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
Wed Jul 11 18:03:26 2018
@@ -57,6 +57,7 @@ import org.bouncycastle.cms.jcajce.JcaSi
 import org.bouncycastle.operator.OperatorCreationException;
 import org.bouncycastle.tsp.TSPException;
 import org.bouncycastle.tsp.TimeStampToken;
+import org.bouncycastle.util.Selector;
 import org.bouncycastle.util.Store;
 import org.bouncycastle.util.StoreException;
 
@@ -269,7 +270,8 @@ public final class ShowSignature
         Store<X509CertificateHolder> certificatesStore = signedData.getCertificates();
         Collection<SignerInformation> signers = signedData.getSignerInfos().getSigners();
         SignerInformation signerInformation = signers.iterator().next();
-        Collection<X509CertificateHolder> matches = certificatesStore.getMatches(signerInformation.getSID());
+        Collection<X509CertificateHolder> matches =
+                certificatesStore.getMatches((Selector<X509CertificateHolder>) signerInformation.getSID());
         X509CertificateHolder certificateHolder = matches.iterator().next();
         X509Certificate certFromSignedData = new JcaX509CertificateConverter().getCertificate(certificateHolder);
         System.out.println("certFromSignedData: " + certFromSignedData);

Modified: pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationCollector.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationCollector.java?rev=1835658&r1=1835657&r2=1835658&view=diff
==============================================================================
--- pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationCollector.java
(original)
+++ pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationCollector.java
Wed Jul 11 18:03:26 2018
@@ -50,6 +50,7 @@ import org.bouncycastle.cms.CMSSignedDat
 import org.bouncycastle.cms.SignerInformation;
 import org.bouncycastle.tsp.TSPException;
 import org.bouncycastle.tsp.TimeStampToken;
+import org.bouncycastle.util.Selector;
 import org.bouncycastle.util.Store;
 
 /**
@@ -240,7 +241,7 @@ public class CertInformationCollector
         SignerInformation signerInformation = signers.iterator().next();
 
         Collection<X509CertificateHolder> matches = certificatesStore
-                .getMatches(signerInformation.getSID());
+                .getMatches((Selector<X509CertificateHolder>) signerInformation.getSID());
 
         X509Certificate certificate = getCertFromHolder(matches.iterator().next());
 

Modified: pdfbox/branches/2.0/examples/src/test/java/org/apache/pdfbox/examples/pdmodel/TestCreateSignature.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/examples/src/test/java/org/apache/pdfbox/examples/pdmodel/TestCreateSignature.java?rev=1835658&r1=1835657&r2=1835658&view=diff
==============================================================================
--- pdfbox/branches/2.0/examples/src/test/java/org/apache/pdfbox/examples/pdmodel/TestCreateSignature.java
(original)
+++ pdfbox/branches/2.0/examples/src/test/java/org/apache/pdfbox/examples/pdmodel/TestCreateSignature.java
Wed Jul 11 18:03:26 2018
@@ -57,6 +57,7 @@ import org.bouncycastle.cms.SignerInform
 import org.bouncycastle.cms.jcajce.JcaSimpleSignerInfoVerifierBuilder;
 import org.bouncycastle.operator.OperatorCreationException;
 import org.bouncycastle.tsp.TSPValidationException;
+import org.bouncycastle.util.Selector;
 import org.bouncycastle.util.Store;
 import org.junit.Assert;
 import org.junit.BeforeClass;
@@ -314,7 +315,7 @@ public class TestCreateSignature
             Store certificatesStore = signedData.getCertificates();
             Collection<SignerInformation> signers = signedData.getSignerInfos().getSigners();
             SignerInformation signerInformation = signers.iterator().next();
-            Collection matches = certificatesStore.getMatches(signerInformation.getSID());
+            Collection matches = certificatesStore.getMatches((Selector<X509CertificateHolder>)
signerInformation.getSID());
             X509CertificateHolder certificateHolder = (X509CertificateHolder) matches.iterator().next();
             X509Certificate certFromSignedData = new JcaX509CertificateConverter().getCertificate(certificateHolder);
 



Mime
View raw message