1 17 18 package org.apache.geronimo.util.asn1.x509; 19 20 import org.apache.geronimo.util.asn1.ASN1Encodable; 21 import org.apache.geronimo.util.asn1.ASN1EncodableVector; 22 import org.apache.geronimo.util.asn1.ASN1Sequence; 23 import org.apache.geronimo.util.asn1.ASN1TaggedObject; 24 import org.apache.geronimo.util.asn1.DERObject; 25 import org.apache.geronimo.util.asn1.DERSequence; 26 27 public class CRLDistPoint 28 extends ASN1Encodable 29 { 30 ASN1Sequence seq = null; 31 32 public static CRLDistPoint getInstance( 33 ASN1TaggedObject obj, 34 boolean explicit) 35 { 36 return getInstance(ASN1Sequence.getInstance(obj, explicit)); 37 } 38 39 public static CRLDistPoint getInstance( 40 Object obj) 41 { 42 if (obj instanceof CRLDistPoint) 43 { 44 return (CRLDistPoint)obj; 45 } 46 else if (obj instanceof ASN1Sequence) 47 { 48 return new CRLDistPoint((ASN1Sequence)obj); 49 } 50 51 throw new IllegalArgumentException ("unknown object in factory"); 52 } 53 54 public CRLDistPoint( 55 ASN1Sequence seq) 56 { 57 this.seq = seq; 58 } 59 60 public CRLDistPoint( 61 DistributionPoint[] points) 62 { 63 ASN1EncodableVector v = new ASN1EncodableVector(); 64 65 for (int i = 0; i != points.length; i++) 66 { 67 v.add(points[i]); 68 } 69 70 seq = new DERSequence(v); 71 } 72 73 78 public DistributionPoint[] getDistributionPoints() 79 { 80 DistributionPoint[] dp = new DistributionPoint[seq.size()]; 81 82 for (int i = 0; i != seq.size(); i++) 83 { 84 dp[i] = DistributionPoint.getInstance(seq.getObjectAt(i)); 85 } 86 87 return dp; 88 } 89 90 96 public DERObject toASN1Object() 97 { 98 return seq; 99 } 100 } 101 | Popular Tags |