pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1846953 - in /pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature: cert/CRLVerifier.java validation/AddValidationInformation.java validation/CertInformationCollector.java validation/CertInformationHelper.java
Date Mon, 19 Nov 2018 21:28:05 GMT
Author: tilman
Date: Mon Nov 19 21:28:05 2018
New Revision: 1846953

URL: http://svn.apache.org/viewvc?rev=1846953&view=rev
Log:
PDFBOX-3017: revert "use bc provider" due to animal-sniffer build failure

Modified:
    pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CRLVerifier.java
    pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/AddValidationInformation.java
    pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationCollector.java
    pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationHelper.java

Modified: pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CRLVerifier.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CRLVerifier.java?rev=1846953&r1=1846952&r2=1846953&view=diff
==============================================================================
--- pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CRLVerifier.java
(original)
+++ pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CRLVerifier.java
Mon Nov 19 21:28:05 2018
@@ -44,7 +44,6 @@ import javax.naming.directory.DirContext
 import javax.naming.directory.InitialDirContext;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.pdfbox.pdmodel.encryption.SecurityProvider;
 
 import org.bouncycastle.asn1.ASN1InputStream;
 import org.bouncycastle.asn1.ASN1Primitive;
@@ -115,7 +114,7 @@ public final class CRLVerifier
                             "not found in certificate chain, so the CRL at " +
                             crlDistributionPointsURL + " could not be verified");
                 }
-                crl.verify(issuerKey, SecurityProvider.getProvider());
+                crl.verify(issuerKey);
 
                 checkRevocation(crl, cert, signDate, crlDistributionPointsURL);
 

Modified: pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/AddValidationInformation.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/AddValidationInformation.java?rev=1846953&r1=1846952&r2=1846953&view=diff
==============================================================================
--- pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/AddValidationInformation.java
(original)
+++ pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/AddValidationInformation.java
Mon Nov 19 21:28:05 2018
@@ -48,7 +48,6 @@ import org.apache.pdfbox.examples.signat
 import org.apache.pdfbox.io.IOUtils;
 import org.apache.pdfbox.pdmodel.PDDocument;
 import org.apache.pdfbox.pdmodel.PDDocumentCatalog;
-import org.apache.pdfbox.pdmodel.encryption.SecurityProvider;
 import org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature;
 import org.bouncycastle.cert.ocsp.BasicOCSPResp;
 import org.bouncycastle.cert.ocsp.OCSPException;
@@ -397,7 +396,7 @@ public class AddValidationInformation
             CertificateVerificationException
     {
         X509CRL crl = CRLVerifier.downloadCRLFromWeb(certInfo.getCrlUrl());
-        crl.verify(certInfo.getIssuerCertificate().getPublicKey(), SecurityProvider.getProvider());
+        crl.verify(certInfo.getIssuerCertificate().getPublicKey());
         CRLVerifier.checkRevocation(crl, certInfo.getCertificate(), signDate.getTime(), certInfo.getCrlUrl());
         COSStream crlStream = writeDataToStream(crl.getEncoded());
         crls.add(crlStream);

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=1846953&r1=1846952&r2=1846953&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
Mon Nov 19 21:28:05 2018
@@ -25,6 +25,7 @@ import java.net.URL;
 import java.security.GeneralSecurityException;
 import java.security.InvalidKeyException;
 import java.security.NoSuchAlgorithmException;
+import java.security.NoSuchProviderException;
 import java.security.SignatureException;
 import java.security.cert.CertificateException;
 import java.security.cert.CertificateFactory;
@@ -37,7 +38,6 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.pdfbox.examples.signature.cert.CertificateVerifier;
 import org.apache.pdfbox.io.IOUtils;
-import org.apache.pdfbox.pdmodel.encryption.SecurityProvider;
 import org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature;
 import org.bouncycastle.asn1.DERSequence;
 import org.bouncycastle.asn1.DERSet;
@@ -267,7 +267,7 @@ public class CertInformationCollector
             {
                 try
                 {
-                    certificate.verify(issuer.getPublicKey(), SecurityProvider.getProvider());
+                    certificate.verify(issuer.getPublicKey());
                 }
                 catch (CertificateException ex)
                 {
@@ -285,6 +285,10 @@ public class CertInformationCollector
                 {
                     throw new CertificateProccessingException(ex);
                 }
+                catch (NoSuchProviderException ex)
+                {
+                    throw new CertificateProccessingException(ex);
+                }
                 LOG.info("Found the right Issuer Cert! for Cert: " + certificate.getSubjectDN()
                         + "\n" + issuer.getSubjectDN());
                 certInfo.issuerCertificate = issuer;

Modified: pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationHelper.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationHelper.java?rev=1846953&r1=1846952&r2=1846953&view=diff
==============================================================================
--- pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationHelper.java
(original)
+++ pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationHelper.java
Mon Nov 19 21:28:05 2018
@@ -20,6 +20,7 @@ import java.io.IOException;
 import java.security.InvalidKeyException;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
+import java.security.NoSuchProviderException;
 import java.security.PublicKey;
 import java.security.SignatureException;
 import java.security.cert.CertificateException;
@@ -29,7 +30,6 @@ import java.util.Enumeration;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.pdfbox.examples.signature.validation.CertInformationCollector.CertSignatureInformation;
-import org.apache.pdfbox.pdmodel.encryption.SecurityProvider;
 import org.apache.pdfbox.util.Hex;
 import org.bouncycastle.asn1.ASN1ObjectIdentifier;
 import org.bouncycastle.asn1.ASN1Sequence;
@@ -104,7 +104,7 @@ public class CertInformationHelper
             {
                 try
                 {
-                    cert.verify(key, SecurityProvider.getProvider());
+                    cert.verify(key);
                     return true;
                 }
                 catch (SignatureException se)
@@ -129,7 +129,7 @@ public class CertInformationHelper
         {
             throw new CertificateProccessingException(e);
         }
-        catch (IOException e)
+        catch (NoSuchProviderException e)
         {
             throw new CertificateProccessingException(e);
         }



Mime
View raw message