pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1868092 - /pdfbox/branches/issue4569/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationHelper.java
Date Mon, 07 Oct 2019 18:29:47 GMT
Author: tilman
Date: Mon Oct  7 18:29:47 2019
New Revision: 1868092

URL: http://svn.apache.org/viewvc?rev=1868092&view=rev
Log:
PDFBOX-3017: remove double code line, use base class, rename variable

Modified:
    pdfbox/branches/issue4569/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationHelper.java

Modified: pdfbox/branches/issue4569/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationHelper.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue4569/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationHelper.java?rev=1868092&r1=1868091&r2=1868092&view=diff
==============================================================================
--- pdfbox/branches/issue4569/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationHelper.java
(original)
+++ pdfbox/branches/issue4569/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationHelper.java
Mon Oct  7 18:29:47 2019
@@ -28,6 +28,7 @@ import org.apache.pdfbox.util.Hex;
 import org.bouncycastle.asn1.ASN1ObjectIdentifier;
 import org.bouncycastle.asn1.ASN1OctetString;
 import org.bouncycastle.asn1.ASN1Sequence;
+import org.bouncycastle.asn1.ASN1TaggedObject;
 import org.bouncycastle.asn1.DERTaggedObject;
 import org.bouncycastle.asn1.DLSequence;
 import org.bouncycastle.asn1.x509.GeneralName;
@@ -114,15 +115,14 @@ public class CertInformationHelper
         {
             DLSequence obj = (DLSequence) objects.nextElement();
 
-            DERTaggedObject derTagged = (DERTaggedObject) obj.getObjectAt(0);
-            derTagged = (DERTaggedObject) derTagged.getObject();
-            derTagged = (DERTaggedObject) derTagged.getObject();
-            if (!(derTagged.getObject() instanceof ASN1OctetString))
+            ASN1TaggedObject taggedObject = (ASN1TaggedObject) obj.getObjectAt(0);
+            taggedObject = (ASN1TaggedObject) taggedObject.getObject();
+            if (!(taggedObject.getObject() instanceof ASN1OctetString))
             {
                 // happens with SampleSignedPDFDocument.pdf
                 continue;
             }
-            ASN1OctetString uri = (ASN1OctetString) derTagged.getObject();
+            ASN1OctetString uri = (ASN1OctetString) taggedObject.getObject();
             String url = new String(uri.getOctets());
             // TODO Check for: DistributionPoint ::= SEQUENCE (see RFC 2459), multiples can
be possible.
 



Mime
View raw message