1 package org.bouncycastle.asn1.cms;
3 import org.bouncycastle.asn1.*;
6 implements DEREncodable
8 private DERObjectIdentifier attrType;
9 private ASN1Set attrValues;
12 * return an Attribute object from the given object.
14 * @param o the object we want converted.
15 * @exception IllegalArgumentException if the object cannot be converted.
17 public static Attribute getInstance(
20 if (o == null || o instanceof Attribute)
25 if (o instanceof ASN1Sequence)
27 return new Attribute((ASN1Sequence)o);
30 throw new IllegalArgumentException("unknown object in factory");
36 attrType = (DERObjectIdentifier)seq.getObjectAt(0);
37 attrValues = (ASN1Set)seq.getObjectAt(1);
41 DERObjectIdentifier attrType,
44 this.attrType = attrType;
45 this.attrValues = attrValues;
48 public DERObjectIdentifier getAttrType()
53 public ASN1Set getAttrValues()
60 * Attribute ::= SEQUENCE {
61 * attrType OBJECT IDENTIFIER,
62 * attrValues SET OF AttributeValue
66 public DERObject getDERObject()
68 DEREncodableVector v = new DEREncodableVector();
73 return new DERSequence(v);