FileDocCategorySizeDatePackage
GeneralSubtree.javaAPI DocAzureus 3.0.3.42906Tue Jun 08 05:12:56 BST 2004org.bouncycastle.asn1.x509

GeneralSubtree

public class GeneralSubtree extends Object implements org.bouncycastle.asn1.DEREncodable

Fields Summary
private GeneralName
base
private org.bouncycastle.asn1.DERInteger
minimum
private org.bouncycastle.asn1.DERInteger
maximum
Constructors Summary
public GeneralSubtree(org.bouncycastle.asn1.ASN1Sequence seq)

		base = GeneralName.getInstance(seq.getObjectAt(0));
		
		switch (seq.size())
        {
        case 1:
            break;
        case 2:
            ASN1TaggedObject o = (ASN1TaggedObject)seq.getObjectAt(1);
            switch (o.getTagNo())
            {
            case 0 :
                minimum = DERInteger.getInstance(o, false);
                break;
            case 1 :
                maximum = DERInteger.getInstance(o, false);
                break;
            default:
                throw new IllegalArgumentException("Bad tag number: " + o.getTagNo());
            }
            break;
        case 3 :
            minimum = DERInteger.getInstance((ASN1TaggedObject)seq.getObjectAt(1), false);
            maximum = DERInteger.getInstance((ASN1TaggedObject)seq.getObjectAt(2), false);
            break;
        default:
            throw new IllegalArgumentException("Bad sequence size: " + seq.size());
		}
	
Methods Summary
public GeneralNamegetBase()

		return base;
	
public org.bouncycastle.asn1.DERObjectgetDERObject()

		ASN1EncodableVector v = new ASN1EncodableVector();

		v.add(base);
		
		if (minimum != null)
        {
			v.add(new DERTaggedObject(false, 0, minimum));
		}
		
		if (maximum != null)
        {
			v.add(new DERTaggedObject(false, 1, maximum));
		}

		return new DERSequence(v);
	
public static org.bouncycastle.asn1.x509.GeneralSubtreegetInstance(org.bouncycastle.asn1.ASN1TaggedObject o, boolean explicit)

		return new GeneralSubtree(ASN1Sequence.getInstance(o, explicit));
	
public static org.bouncycastle.asn1.x509.GeneralSubtreegetInstance(java.lang.Object obj)

		if (obj == null)
        {
			return null;
		}

		if (obj instanceof GeneralSubtree)
        {
			return (GeneralSubtree)obj;
		}

		return new GeneralSubtree(ASN1Sequence.getInstance(obj));
	
public java.math.BigIntegergetMaximum()

        if (maximum == null)
        {
            return null;
        }

		return maximum.getValue();
	
public java.math.BigIntegergetMinimum()

		if (minimum == null)
        {
			return BigInteger.valueOf(0);
		}
		
		return minimum.getValue();