Top Description Fields Constructors Methods
org.bouncycastle.asn1.cms

public Class Attribute

extends ASN1Object
Class Inheritance
Known Direct Subclasses
org.bouncycastle.asn1.smime.SMIMECapabilitiesAttribute, org.bouncycastle.asn1.smime.SMIMEEncryptionKeyPreferenceAttribute
Imports
org.bouncycastle.asn1.ASN1Encodable, .ASN1EncodableVector, .ASN1Object, .ASN1ObjectIdentifier, .ASN1Primitive, .ASN1Sequence, .ASN1Set, .DERSequence

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.

Field Summary

Modifier and TypeField and Description
private ASN1ObjectIdentifier
private ASN1Set

Constructor Summary

AccessConstructor and Description
private
public
Attribute(ASN1ObjectIdentifier attrType, ASN1Set attrValues)

Method Summary

Modifier and TypeMethod and Description
public ASN1Encodable[]
public ASN1ObjectIdentifier
public ASN1Set
public static Attribute
getInstance(Object
the object we want converted.
o
)

Return an Attribute object from the given object.

public ASN1Primitive
toASN1Primitive()

Implements abstract org.bouncycastle.asn1.ASN1Object.toASN1Primitive.

Implements org.bouncycastle.asn1.ASN1Encodable.toASN1Primitive.

Produce an object suitable for an ASN1OutputStream.
Inherited from org.bouncycastle.asn1.ASN1Object:
equalsgetEncodedgetEncodedhasEncodedTagValuehashCode

Field Detail

attrTypeback to summary
private ASN1ObjectIdentifier attrType
attrValuesback to summary
private ASN1Set attrValues

Constructor Detail

Attributeback to summary
private Attribute(ASN1Sequence seq)
Attributeback to summary
public Attribute(ASN1ObjectIdentifier attrType, ASN1Set attrValues)

Method Detail

getAttributeValuesback to summary
public ASN1Encodable[] getAttributeValues()
getAttrTypeback to summary
public ASN1ObjectIdentifier getAttrType()
getAttrValuesback to summary
public ASN1Set getAttrValues()
getInstanceback to summary
public static Attribute getInstance(Object o)

Return an Attribute object from the given object.

Accepted inputs:

Parameters
o:Object

the object we want converted.

Exceptions
IllegalArgumentException:
if the object cannot be converted.
toASN1Primitiveback to summary
public ASN1Primitive toASN1Primitive()

Implements abstract org.bouncycastle.asn1.ASN1Object.toASN1Primitive.

Implements org.bouncycastle.asn1.ASN1Encodable.toASN1Primitive.

Produce an object suitable for an ASN1OutputStream.

Returns:ASN1Primitive

Doc from org.bouncycastle.asn1.ASN1Object.toASN1Primitive.

a primitive representation of this object.