pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1868094 - in /pdfbox/branches/issue45/examples/src/main/java/org/apache/pdfbox/examples/signature: cert/CertificateVerifier.java validation/CertInformationHelper.java
Date Mon, 07 Oct 2019 18:40:59 GMT
Author: tilman
Date: Mon Oct  7 18:40:59 2019
New Revision: 1868094

URL: http://svn.apache.org/viewvc?rev=1868094&view=rev
Log:
PDFBOX-3017: use constant.equals; use base class

Modified:
    pdfbox/branches/issue45/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CertificateVerifier.java
    pdfbox/branches/issue45/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationHelper.java

Modified: pdfbox/branches/issue45/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CertificateVerifier.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue45/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CertificateVerifier.java?rev=1868094&r1=1868093&r2=1868094&view=diff
==============================================================================
--- pdfbox/branches/issue45/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CertificateVerifier.java
(original)
+++ pdfbox/branches/issue45/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CertificateVerifier.java
Mon Oct  7 18:40:59 2019
@@ -298,7 +298,7 @@ public final class CertificateVerifier
             // AccessDescription
             ASN1Sequence obj = (ASN1Sequence) objects.nextElement();
             ASN1ObjectIdentifier oid = (ASN1ObjectIdentifier) obj.getObjectAt(0);
-            if (!oid.equals(X509ObjectIdentifiers.id_ad_caIssuers))
+            if (!X509ObjectIdentifiers.id_ad_caIssuers.equals(oid))
             {
                 continue;
             }
@@ -414,7 +414,7 @@ public final class CertificateVerifier
                 ASN1ObjectIdentifier oid = (ASN1ObjectIdentifier) obj.getObjectAt(0);
                 // accessLocation
                 ASN1TaggedObject location = (ASN1TaggedObject) obj.getObjectAt(1);
-                if (oid.equals(X509ObjectIdentifiers.id_ad_ocsp)
+                if (X509ObjectIdentifiers.id_ad_ocsp.equals(oid)
                         && location.getTagNo() == GeneralName.uniformResourceIdentifier)
                 {
                     ASN1OctetString url = (ASN1OctetString) location.getObject();

Modified: pdfbox/branches/issue45/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationHelper.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue45/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationHelper.java?rev=1868094&r1=1868093&r2=1868094&view=diff
==============================================================================
--- pdfbox/branches/issue45/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationHelper.java
(original)
+++ pdfbox/branches/issue45/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationHelper.java
Mon Oct  7 18:40:59 2019
@@ -25,7 +25,7 @@ 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.util.Hex;
-import org.bouncycastle.asn1.ASN1ObjectIdentifier;
+import org.bouncycastle.asn1.ASN1Encodable;
 import org.bouncycastle.asn1.ASN1OctetString;
 import org.bouncycastle.asn1.ASN1Sequence;
 import org.bouncycastle.asn1.ASN1TaggedObject;
@@ -79,17 +79,17 @@ public class CertInformationHelper
         {
             // AccessDescription
             ASN1Sequence obj = (ASN1Sequence) objects.nextElement();
-            ASN1ObjectIdentifier oid = (ASN1ObjectIdentifier) obj.getObjectAt(0);
+            ASN1Encodable oid = obj.getObjectAt(0);
             // accessLocation
             ASN1TaggedObject location = (ASN1TaggedObject) obj.getObjectAt(1);
 
-            if (oid.equals(X509ObjectIdentifiers.id_ad_ocsp)
+            if (X509ObjectIdentifiers.id_ad_ocsp.equals(oid)
                     && location.getTagNo() == GeneralName.uniformResourceIdentifier)
             {
                 ASN1OctetString url = (ASN1OctetString) location.getObject();
                 certInfo.setOcspUrl(new String(url.getOctets()));
             }
-            else if (oid.equals(X509ObjectIdentifiers.id_ad_caIssuers))
+            else if (X509ObjectIdentifiers.id_ad_caIssuers.equals(oid))
             {
                 ASN1OctetString uri = (ASN1OctetString) location.getObject();
                 certInfo.setIssuerUrl(new String(uri.getOctets()));



Mime
View raw message