2003/02/12 06:21:04
[org.ibex.core.git] / src / org / bouncycastle / asn1 / x509 / CRLDistPoint.java
index 780ab16..11b347a 100644 (file)
@@ -5,17 +5,47 @@ import org.bouncycastle.asn1.*;
 public class CRLDistPoint
     implements DEREncodable
 {
-    DERConstructedSequence  seq = null;
+    ASN1Sequence  seq = null;
 
+    public static CRLDistPoint getInstance(
+        ASN1TaggedObject obj,
+        boolean          explicit)
+    {
+        return getInstance(ASN1Sequence.getInstance(obj, explicit));
+    }
+
+    public static CRLDistPoint getInstance(
+        Object  obj)
+    {
+        if (obj instanceof CRLDistPoint)
+        {
+            return (CRLDistPoint)obj;
+        }
+        else if (obj instanceof ASN1Sequence)
+        {
+            return new CRLDistPoint((ASN1Sequence)obj);
+        }
+
+        throw new IllegalArgumentException("unknown object in factory");
+    }
+       
+    public CRLDistPoint(
+        ASN1Sequence seq)
+    {
+        this.seq = seq;
+    }
+    
     public CRLDistPoint(
         DistributionPoint[] points)
     {
-        seq = new DERConstructedSequence();
+        DEREncodableVector  v = new DEREncodableVector();
 
         for (int i = 0; i != points.length; i++)
         {
-            seq.addObject(points[i]);
+            v.add(points[i]);
         }
+
+        seq = new DERSequence(v);
     }
 
     /**