FileDocCategorySizeDatePackage
NameConstraints.javaAPI DocAndroid 1.5 API2627Wed May 06 22:41:06 BST 2009org.bouncycastle.asn1.x509

NameConstraints

public class NameConstraints extends org.bouncycastle.asn1.ASN1Encodable

Fields Summary
private org.bouncycastle.asn1.ASN1Sequence
permitted
private org.bouncycastle.asn1.ASN1Sequence
excluded
Constructors Summary
public NameConstraints(org.bouncycastle.asn1.ASN1Sequence seq)

        Enumeration e = seq.getObjects();
        while (e.hasMoreElements())
        {
            ASN1TaggedObject o = ASN1TaggedObject.getInstance(e.nextElement());
            switch (o.getTagNo())
            {
            case 0:
                permitted = ASN1Sequence.getInstance(o, false);
                break;
            case 1:
                excluded = ASN1Sequence.getInstance(o, false);
                break;
            }
        }
    
public NameConstraints(Vector permitted, Vector excluded)
Constructor from a given details.

permitted and excluded are Vectors of GeneralSubtree objects.

param
permitted Permitted subtrees
param
excluded Excludes subtrees

        if (permitted != null)
        {
            this.permitted = createSequence(permitted);
        }
        if (excluded != null)
        {
            this.excluded = createSequence(excluded);
        }
    
Methods Summary
private org.bouncycastle.asn1.DERSequencecreateSequence(java.util.Vector subtree)

        ASN1EncodableVector vec = new ASN1EncodableVector();
        Enumeration e = subtree.elements(); 
        while (e.hasMoreElements())
        {
            vec.add((GeneralSubtree)e.nextElement());
        }
        
        return new DERSequence(vec);
    
public org.bouncycastle.asn1.ASN1SequencegetExcludedSubtrees()

        return excluded;
    
public org.bouncycastle.asn1.ASN1SequencegetPermittedSubtrees()

        return permitted;
    
public org.bouncycastle.asn1.DERObjecttoASN1Object()

        ASN1EncodableVector v = new ASN1EncodableVector();

        if (permitted != null) 
        {
            v.add(new DERTaggedObject(false, 0, permitted));
        }

        if (excluded != null) 
        {
            v.add(new DERTaggedObject(false, 1, excluded));
        }

        return new DERSequence(v);