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.ASN1Sequence; 22 import org.apache.geronimo.util.asn1.ASN1TaggedObject; 23 import org.apache.geronimo.util.asn1.DERBoolean; 24 import org.apache.geronimo.util.asn1.DERObject; 25 26 35 public class IssuingDistributionPoint 36 extends ASN1Encodable 37 { 38 private boolean onlyContainsUserCerts; 39 private boolean onlyContainsCACerts; 40 private boolean indirectCRL; 41 private boolean onlyContainsAttributeCerts; 42 43 private ASN1Sequence seq; 44 45 public static IssuingDistributionPoint getInstance( 46 ASN1TaggedObject obj, 47 boolean explicit) 48 { 49 return getInstance(ASN1Sequence.getInstance(obj, explicit)); 50 } 51 52 public static IssuingDistributionPoint getInstance( 53 Object obj) 54 { 55 if (obj == null || obj instanceof IssuingDistributionPoint) 56 { 57 return (IssuingDistributionPoint)obj; 58 } 59 else if (obj instanceof ASN1Sequence) 60 { 61 return new IssuingDistributionPoint((ASN1Sequence)obj); 62 } 63 64 throw new IllegalArgumentException ("unknown object in factory"); 65 } 66 67 70 public IssuingDistributionPoint( 71 ASN1Sequence seq) 72 { 73 this.seq = seq; 74 75 for (int i = 0; i != seq.size(); i++) 76 { 77 ASN1TaggedObject o = (ASN1TaggedObject)seq.getObjectAt(i); 78 79 switch (o.getTagNo()) 80 { 81 case 0: 82 break; 83 case 1: 84 onlyContainsUserCerts = DERBoolean.getInstance(o, false).isTrue(); 85 break; 86 case 2: 87 onlyContainsCACerts = DERBoolean.getInstance(o, false).isTrue(); 88 break; 89 case 3: 90 break; 91 case 4: 92 indirectCRL = DERBoolean.getInstance(o, false).isTrue(); 93 break; 94 case 5: 95 onlyContainsAttributeCerts = DERBoolean.getInstance(o, false).isTrue(); 96 break; 97 default: 98 throw new IllegalArgumentException ("unknown tag in IssuingDistributionPoint"); 99 } 100 } 101 } 102 103 public boolean onlyContainsUserCerts() 104 { 105 return onlyContainsUserCerts; 106 } 107 108 public boolean onlyContainsCACerts() 109 { 110 return onlyContainsCACerts; 111 } 112 113 public boolean isIndirectCRL() 114 { 115 return indirectCRL; 116 } 117 118 public boolean onlyContainsAttributeCerts() 119 { 120 return onlyContainsAttributeCerts; 121 } 122 123 public DERObject toASN1Object() 124 { 125 return seq; 126 } 127 } 128 | Popular Tags |