Package org.bouncycastle.asn1.cms
Class Attribute
java.lang.Object
org.bouncycastle.asn1.ASN1Object
org.bouncycastle.asn1.cms.Attribute
- All Implemented Interfaces:
ASN1Encodable
,Encodable
- Direct Known Subclasses:
SMIMECapabilitiesAttribute
,SMIMEEncryptionKeyPreferenceAttribute
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Attribute
Return an Attribute object from the given object.Produce an object suitable for an ASN1OutputStream.Methods inherited from class org.bouncycastle.asn1.ASN1Object
equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode
-
Constructor Details
-
Attribute
-
-
Method Details
-
getInstance
Return an Attribute object from the given object.Accepted inputs:
- null → null
-
Attribute
object -
ASN1Sequence
input formats with Attribute structure inside
- Parameters:
o
- the object we want converted.- Throws:
IllegalArgumentException
- if the object cannot be converted.
-
getAttrType
-
getAttrValues
-
getAttributeValues
-
toASN1Primitive
Produce an object suitable for an ASN1OutputStream.- Specified by:
toASN1Primitive
in interfaceASN1Encodable
- Specified by:
toASN1Primitive
in classASN1Object
- Returns:
- a primitive representation of this object.
-