FileDocCategorySizeDatePackage
X509Attribute.javaAPI DocAndroid 1.5 API2113Wed May 06 22:41:06 BST 2009org.bouncycastle.x509

X509Attribute

public class X509Attribute extends org.bouncycastle.asn1.ASN1Encodable
Class for carrying the values in an X.509 Attribute.

Fields Summary
org.bouncycastle.asn1.x509.Attribute
attr
Constructors Summary
X509Attribute(org.bouncycastle.asn1.ASN1Encodable at)

param
at an object representing an attribute.

        this.attr = Attribute.getInstance(at);
    
public X509Attribute(String oid, org.bouncycastle.asn1.ASN1Encodable value)
Create an X.509 Attribute with the type given by the passed in oid and the value represented by an ASN.1 Set containing value.

param
oid type of the attribute
param
value value object to go into the atribute's value set.

        this.attr = new Attribute(new DERObjectIdentifier(oid), new DERSet(value));
    
public X509Attribute(String oid, org.bouncycastle.asn1.ASN1EncodableVector value)
Create an X.59 Attribute with the type given by the passed in oid and the value represented by an ASN.1 Set containing the objects in value.

param
oid type of the attribute
param
value vector of values to go in the attribute's value set.

        this.attr = new Attribute(new DERObjectIdentifier(oid), new DERSet(value));
    
Methods Summary
public java.lang.StringgetOID()

        return attr.getAttrType().getId();
    
public org.bouncycastle.asn1.ASN1Encodable[]getValues()

        ASN1Set         s = attr.getAttrValues();
        ASN1Encodable[] values = new ASN1Encodable[s.size()];
        
        for (int i = 0; i != s.size(); i++)
        {
            values[i] = (ASN1Encodable)s.getObjectAt(i);
        }
        
        return values;
    
public org.bouncycastle.asn1.DERObjecttoASN1Object()

        return attr.toASN1Object();