Bouncy Castle Cryptography 1.50

org.bouncycastle.asn1.cms
Class Attribute

java.lang.Object
  extended by org.bouncycastle.asn1.ASN1Object
      extended by org.bouncycastle.asn1.cms.Attribute
All Implemented Interfaces:
ASN1Encodable
Direct Known Subclasses:
SMIMECapabilitiesAttribute, SMIMEEncryptionKeyPreferenceAttribute

public class Attribute
extends ASN1Object

RFC 5652: Attribute is a pair of OID (as type identifier) + set of values.

 Attribute ::= SEQUENCE {
     attrType OBJECT IDENTIFIER,
     attrValues SET OF AttributeValue
 }
 
 AttributeValue ::= ANY
 

General rule on values is that same AttributeValue must not be included multiple times into the set. That is, if the value is a SET OF INTEGERs, then having same value repeated is wrong: (1, 1), but different values is OK: (1, 2). Normally the AttributeValue syntaxes are more complicated than that.

General rule of Attribute usage is that the Attributes containers must not have multiple Attribute:s with same attrType (OID) there.


Constructor Summary
Attribute(ASN1ObjectIdentifier attrType, ASN1Set attrValues)
           
Attribute(DERObjectIdentifier attrType, ASN1Set attrValues)
          Deprecated. use ASN1ObjectIdentifier
 
Method Summary
 ASN1Encodable[] getAttributeValues()
           
 ASN1ObjectIdentifier getAttrType()
           
 ASN1Set getAttrValues()
           
static Attribute getInstance(java.lang.Object o)
          Return an Attribute object from the given object.
 ASN1Primitive toASN1Primitive()
          Produce an object suitable for an ASN1OutputStream.
 
Methods inherited from class org.bouncycastle.asn1.ASN1Object
equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode, toASN1Object
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Attribute

public Attribute(DERObjectIdentifier attrType,
                 ASN1Set attrValues)
Deprecated. use ASN1ObjectIdentifier


Attribute

public Attribute(ASN1ObjectIdentifier attrType,
                 ASN1Set attrValues)
Method Detail

getInstance

public static Attribute getInstance(java.lang.Object o)
Return an Attribute object from the given object.

Accepted inputs:

Parameters:
o - the object we want converted.
Throws:
java.lang.IllegalArgumentException - if the object cannot be converted.

getAttrType

public ASN1ObjectIdentifier getAttrType()

getAttrValues

public ASN1Set getAttrValues()

getAttributeValues

public ASN1Encodable[] getAttributeValues()

toASN1Primitive

public ASN1Primitive toASN1Primitive()
Produce an object suitable for an ASN1OutputStream.

Specified by:
toASN1Primitive in interface ASN1Encodable
Specified by:
toASN1Primitive in class ASN1Object

Bouncy Castle Cryptography 1.50