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.ASN1Sequence; 23 import org.apache.geronimo.util.asn1.ASN1TaggedObject; 24 import org.apache.geronimo.util.asn1.DERObject; 25 import org.apache.geronimo.util.asn1.DERTaggedObject; 26 27 public class AttCertIssuer 28 extends ASN1Encodable 29 implements ASN1Choice 30 { 31 ASN1Encodable obj; 32 DERObject choiceObj; 33 34 public static AttCertIssuer getInstance( 35 Object obj) 36 { 37 if (obj instanceof AttCertIssuer) 38 { 39 return (AttCertIssuer)obj; 40 } 41 else if (obj instanceof V2Form) 42 { 43 return new AttCertIssuer(V2Form.getInstance(obj)); 44 } 45 else if (obj instanceof GeneralNames) 46 { 47 return new AttCertIssuer((GeneralNames)obj); 48 } 49 else if (obj instanceof ASN1TaggedObject) 50 { 51 return new AttCertIssuer(V2Form.getInstance((ASN1TaggedObject)obj, false)); 52 } 53 else if (obj instanceof ASN1Sequence) 54 { 55 return new AttCertIssuer(GeneralNames.getInstance(obj)); 56 } 57 58 throw new IllegalArgumentException ("unknown object in factory: " + obj.getClass()); 59 } 60 61 public static AttCertIssuer getInstance( 62 ASN1TaggedObject obj, 63 boolean explicit) 64 { 65 return getInstance(obj.getObject()); } 67 68 73 public AttCertIssuer( 74 GeneralNames names) 75 { 76 obj = names; 77 choiceObj = obj.getDERObject(); 78 } 79 80 public AttCertIssuer( 81 V2Form v2Form) 82 { 83 obj = v2Form; 84 choiceObj = new DERTaggedObject(false, 0, obj); 85 } 86 87 public ASN1Encodable getIssuer() 88 { 89 return obj; 90 } 91 92 102 public DERObject toASN1Object() 103 { 104 return choiceObj; 105 } 106 } 107 | Popular Tags |