pdfbox-commits mailing list archives

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

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

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

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationHelper.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationHelper.java?rev=1868089&r1=1868088&r2=1868089&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationHelper.java
(original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationHelper.java
Mon Oct  7 18:29:32 2019
@@ -29,8 +29,6 @@ import org.bouncycastle.asn1.ASN1ObjectI
 import org.bouncycastle.asn1.ASN1OctetString;
 import org.bouncycastle.asn1.ASN1Sequence;
 import org.bouncycastle.asn1.ASN1TaggedObject;
-import org.bouncycastle.asn1.DEROctetString;
-import org.bouncycastle.asn1.DERTaggedObject;
 import org.bouncycastle.asn1.DLSequence;
 import org.bouncycastle.asn1.x509.GeneralName;
 import org.bouncycastle.asn1.x509.X509ObjectIdentifiers;
@@ -116,15 +114,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 DEROctetString))
+            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