Package org.bouncycastle.asn1.cms
Class Attribute
- java.lang.Object
-
- org.bouncycastle.asn1.ASN1Object
-
- org.bouncycastle.asn1.cms.Attribute
-
- All Implemented Interfaces:
org.bouncycastle.asn1.ASN1Encodable,org.bouncycastle.util.Encodable
- Direct Known Subclasses:
SMIMECapabilitiesAttribute,SMIMEEncryptionKeyPreferenceAttribute
public class Attribute extends org.bouncycastle.asn1.ASN1ObjectRFC 5652: Attribute is a pair of OID (as type identifier) + set of values.Attribute ::= SEQUENCE { attrType OBJECT IDENTIFIER, attrValues SET OF AttributeValue } AttributeValue ::= ANYGeneral 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
Attributescontainers must not have multiple Attribute:s with same attrType (OID) there.
-
-
Constructor Summary
Constructors Constructor Description Attribute(org.bouncycastle.asn1.ASN1ObjectIdentifier attrType, org.bouncycastle.asn1.ASN1Set attrValues)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.bouncycastle.asn1.ASN1Encodable[]getAttributeValues()org.bouncycastle.asn1.ASN1ObjectIdentifiergetAttrType()org.bouncycastle.asn1.ASN1SetgetAttrValues()static AttributegetInstance(java.lang.Object o)Return an Attribute object from the given object.org.bouncycastle.asn1.ASN1PrimitivetoASN1Primitive()Produce an object suitable for an ASN1OutputStream.
-
-
-
Method Detail
-
getInstance
public static Attribute getInstance(java.lang.Object o)
Return an Attribute object from the given object.Accepted inputs:
- null → null
-
Attributeobject -
ASN1Sequenceinput formats with Attribute structure inside
- Parameters:
o- the object we want converted.- Throws:
java.lang.IllegalArgumentException- if the object cannot be converted.
-
getAttrType
public org.bouncycastle.asn1.ASN1ObjectIdentifier getAttrType()
-
getAttrValues
public org.bouncycastle.asn1.ASN1Set getAttrValues()
-
getAttributeValues
public org.bouncycastle.asn1.ASN1Encodable[] getAttributeValues()
-
toASN1Primitive
public org.bouncycastle.asn1.ASN1Primitive toASN1Primitive()
Produce an object suitable for an ASN1OutputStream.- Specified by:
toASN1Primitivein interfaceorg.bouncycastle.asn1.ASN1Encodable- Specified by:
toASN1Primitivein classorg.bouncycastle.asn1.ASN1Object
-
-