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

SubjectDirectoryAttributes

public class SubjectDirectoryAttributes extends org.bouncycastle.asn1.ASN1Encodable
This extension may contain further X.500 attributes of the subject. See also RFC 3039.
SubjectDirectoryAttributes ::= Attributes
Attributes ::= SEQUENCE SIZE (1..MAX) OF Attribute
Attribute ::= SEQUENCE
{
type AttributeType
values SET OF AttributeValue
}

AttributeType ::= OBJECT IDENTIFIER
AttributeValue ::= ANY DEFINED BY AttributeType
see
org.bouncycastle.asn1.x509.X509Name for AttributeType ObjectIdentifiers.

Fields Summary
private Vector
attributes
Constructors Summary
public SubjectDirectoryAttributes(org.bouncycastle.asn1.ASN1Sequence seq)
Constructor from ASN1Sequence. The sequence is of type SubjectDirectoryAttributes:
SubjectDirectoryAttributes ::= Attributes
Attributes ::= SEQUENCE SIZE (1..MAX) OF Attribute
Attribute ::= SEQUENCE
{
type AttributeType
values SET OF AttributeValue
}

AttributeType ::= OBJECT IDENTIFIER
AttributeValue ::= ANY DEFINED BY AttributeType

param
seq The ASN.1 sequence.

        Enumeration e = seq.getObjects();

        while (e.hasMoreElements())
        {
            ASN1Sequence s = ASN1Sequence.getInstance(e.nextElement());
            attributes.addElement(new Attribute(s));
        }
    
public SubjectDirectoryAttributes(Vector attributes)
Constructor from a vector of attributes. The vector consists of attributes of type {@link Attribute Attribute}

param
attributes The attributes.

        Enumeration e = attributes.elements();

        while (e.hasMoreElements())
        {
            this.attributes.addElement(e.nextElement());
        }
    
Methods Summary
public java.util.VectorgetAttributes()

return
Returns the attributes.

        return attributes;
    
public static org.bouncycastle.asn1.x509.SubjectDirectoryAttributesgetInstance(java.lang.Object obj)


       
         
    
        if (obj == null || obj instanceof SubjectDirectoryAttributes)
        {
            return (SubjectDirectoryAttributes)obj;
        }

        if (obj instanceof ASN1Sequence)
        {
            return new SubjectDirectoryAttributes((ASN1Sequence)obj);
        }

        throw new IllegalArgumentException("illegal object in getInstance: " + obj.getClass().getName());
    
public org.bouncycastle.asn1.DERObjecttoASN1Object()
Produce an object suitable for an ASN1OutputStream. Returns:
SubjectDirectoryAttributes ::= Attributes
Attributes ::= SEQUENCE SIZE (1..MAX) OF Attribute
Attribute ::= SEQUENCE
{
type AttributeType
values SET OF AttributeValue
}

AttributeType ::= OBJECT IDENTIFIER
AttributeValue ::= ANY DEFINED BY AttributeType

return
a DERObject

        ASN1EncodableVector vec = new ASN1EncodableVector();
        Enumeration e = attributes.elements();

        while (e.hasMoreElements())
        {

            vec.add((Attribute)e.nextElement());
        }

        return new DERSequence(vec);