FileDocCategorySizeDatePackage
OtherKeyAttribute.javaAPI DocAndroid 1.5 API2067Wed May 06 22:41:06 BST 2009org.bouncycastle.asn1.cms

OtherKeyAttribute

public class OtherKeyAttribute extends org.bouncycastle.asn1.ASN1Encodable

Fields Summary
private org.bouncycastle.asn1.DERObjectIdentifier
keyAttrId
private org.bouncycastle.asn1.DEREncodable
keyAttr
Constructors Summary
public OtherKeyAttribute(org.bouncycastle.asn1.ASN1Sequence seq)

        keyAttrId = (DERObjectIdentifier)seq.getObjectAt(0);
        keyAttr = seq.getObjectAt(1);
    
public OtherKeyAttribute(org.bouncycastle.asn1.DERObjectIdentifier keyAttrId, org.bouncycastle.asn1.DEREncodable keyAttr)

        this.keyAttrId = keyAttrId;
        this.keyAttr = keyAttr;
    
Methods Summary
public static org.bouncycastle.asn1.cms.OtherKeyAttributegetInstance(java.lang.Object o)
return an OtherKeyAttribute object from the given object.

param
o the object we want converted.
exception
IllegalArgumentException if the object cannot be converted.

        if (o == null || o instanceof OtherKeyAttribute)
        {
            return (OtherKeyAttribute)o;
        }
        
        if (o instanceof ASN1Sequence)
        {
            return new OtherKeyAttribute((ASN1Sequence)o);
        }

        throw new IllegalArgumentException("unknown object in factory");
    
public org.bouncycastle.asn1.DEREncodablegetKeyAttr()

        return keyAttr;
    
public org.bouncycastle.asn1.DERObjectIdentifiergetKeyAttrId()

        return keyAttrId;
    
public org.bouncycastle.asn1.DERObjecttoASN1Object()
Produce an object suitable for an ASN1OutputStream.
OtherKeyAttribute ::= SEQUENCE {
keyAttrId OBJECT IDENTIFIER,
keyAttr ANY DEFINED BY keyAttrId OPTIONAL
}

        ASN1EncodableVector v = new ASN1EncodableVector();

        v.add(keyAttrId);
        v.add(keyAttr);

        return new DERSequence(v);