resolve darcs stupidity
[org.ibex.core.git] / src / org / bouncycastle / asn1 / x509 / GeneralName.java
index 41c2578..eee7e17 100644 (file)
@@ -27,8 +27,9 @@ import org.bouncycastle.asn1.*;
 public class GeneralName
     implements DEREncodable
 {
-    DEREncodable  obj;
-    int           tag;
+    DEREncodable        obj;
+    int                 tag;
+        boolean                 isInsideImplicit = false;               // if we are in an implicitly tagged object
 
     public GeneralName(
         X509Name  directoryName)
@@ -71,8 +72,26 @@ public class GeneralName
         this.tag = tag;
     }
 
+    /**
+     * mark whether or not we are contained inside an implicitly tagged
+     * object.
+     * @deprecated
+     */
+        public void markInsideImplicit(
+                boolean         isInsideImplicit)
+        {
+                this.isInsideImplicit = isInsideImplicit;
+        }
+
     public DERObject getDERObject()
     {
-        return new DERTaggedObject(false, tag, obj);
+        if (obj.getDERObject() instanceof ASN1Sequence)
+        {
+            return new DERTaggedObject(true, tag, obj);
+        }
+        else
+        {
+            return new DERTaggedObject(false, tag, obj);
+        }
     }
 }