|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--iaik.asn1.structures.Attribute
This class implements the ASN.1 type Attribute.
An Attribute object consists of an attribute type (specified by an
object identifier) and one or more attribute values:
Attribute ::= SEQUENCE {
type AttributeType,
values SET OF AttributeValue
-- at least one value is required --
}
AttributeType ::= OBJECT IDENTIFIER
AttributeValue ::= ANY DEFINED BY type
When creating a new Attribute object, the attribute type has to be specified
as ObjectID, and the attribute value(s) have to be supplied
as array of ASN1Objects, e.g.:
ChoiceOfTime choiceOfTime = new ChoiceOfTime();
ASN1Object[] asn1Objects = new ASN1Object[] { choiceOfTime.toASN1Object() };
Attribute attribute = new Attribute(ObjectID.signingTime, asn1Objects);
The example above creates a PKCS#9 SigningTime attribute to be used for
specifying the time a signer has signed a PKCS#7 SignedData
message.
ASN1Type| Constructor Summary | |
Attribute()
Creates an empty Attribute. |
|
Attribute(ASN1Object obj)
Creates an Attribute from an ASN1Object. |
|
Attribute(ObjectID type,
ASN1Object[] value)
Creates an Attribute from attribute type (ObjectID) and attribute values. |
|
| Method Summary | |
void |
decode(ASN1Object obj)
Decodes an Attribute from the given ASN1Object. |
boolean |
equals(java.lang.Object obj)
Compares two Attributes. |
ObjectID |
getType()
Returns the type of this Attribute. |
ASN1Object[] |
getValue()
Returns the value of this Attribute. |
ASN1Object |
toASN1Object()
Returns the Attribute as an ASN1Object. |
java.lang.String |
toString()
Returns a string that represents the contents of this Attribute. |
| Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
public Attribute()
public Attribute(ObjectID type,
ASN1Object[] value)
type - the type of the attribute as ObjectIDvalue - the value of the attribute as array of ASN1Objects
public Attribute(ASN1Object obj)
throws CodingException
toASN1Object()
method.obj - the Attribute as ASN1Object| Method Detail |
public void decode(ASN1Object obj)
throws CodingException
toASN1Object()
method.obj - the ASN.1 type as ASN1Objectpublic ASN1Object toASN1Object()
public ObjectID getType()
public ASN1Object[] getValue()
public boolean equals(java.lang.Object obj)
obj - the other Attributetrue, if the two Attributes are equal, false otherwisepublic java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||