1 17 18 package org.apache.geronimo.util.asn1.x509; 19 20 import org.apache.geronimo.util.asn1.ASN1Choice; 21 import org.apache.geronimo.util.asn1.ASN1Encodable; 22 import org.apache.geronimo.util.asn1.ASN1Set; 23 import org.apache.geronimo.util.asn1.ASN1TaggedObject; 24 import org.apache.geronimo.util.asn1.DEREncodable; 25 import org.apache.geronimo.util.asn1.DERObject; 26 import org.apache.geronimo.util.asn1.DERTaggedObject; 27 28 37 public class DistributionPointName 38 extends ASN1Encodable 39 implements ASN1Choice 40 { 41 DEREncodable name; 42 int type; 43 44 public static final int FULL_NAME = 0; 45 public static final int NAME_RELATIVE_TO_CRL_ISSUER = 1; 46 47 public static DistributionPointName getInstance( 48 ASN1TaggedObject obj, 49 boolean explicit) 50 { 51 return getInstance(ASN1TaggedObject.getInstance(obj, true)); 52 } 53 54 public static DistributionPointName getInstance( 55 Object obj) 56 { 57 if (obj == null || obj instanceof DistributionPointName) 58 { 59 return (DistributionPointName)obj; 60 } 61 else if (obj instanceof ASN1TaggedObject) 62 { 63 return new DistributionPointName((ASN1TaggedObject)obj); 64 } 65 66 throw new IllegalArgumentException ("unknown object in factory"); 67 } 68 69 72 public DistributionPointName( 73 int type, 74 DEREncodable name) 75 { 76 this.type = type; 77 this.name = name; 78 } 79 80 public DistributionPointName( 81 int type, 82 ASN1Encodable name) 83 { 84 this.type = type; 85 this.name = name; 86 } 87 88 93 public int getType() 94 { 95 return this.type; 96 } 97 98 103 public ASN1Encodable getName() 104 { 105 return (ASN1Encodable)name; 106 } 107 108 public DistributionPointName( 109 ASN1TaggedObject obj) 110 { 111 this.type = obj.getTagNo(); 112 113 if (type == 0) 114 { 115 this.name = GeneralNames.getInstance(obj, false); 116 } 117 else 118 { 119 this.name = ASN1Set.getInstance(obj, false); 120 } 121 } 122 123 public DERObject toASN1Object() 124 { 125 return new DERTaggedObject(false, type, name); 126 } 127 } 128 | Popular Tags |