|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object iaik.cms.KeyAttribute
public abstract class KeyAttribute
This class is the basic implementation for key attributes components of the CMS type OtherKeyAttribute. Every class, which implements a key attribute must be derived from this class.
Although using OtherKeyAttribute generally should be avoided it may be used for providing additional information for identifying a key:
OtherKeyAttribute ::= SEQUENCE { keyAttrId OBJECT IDENTIFIER, keyAttr ANY DEFINED BY keyAttrId OPTIONAL }Any class implementing a particular keyAttr component has to be extended by this class and therefore has to implement the abstract methods
decode
, toASN1Object
, getKeyAttributeID
and equals)
. The keyAttrId to be returned by
method getKeyAttrId
is the one identifying the particular key
attribute and shall be used for registering
the corresponding class as implemenation for this key attribute component, e.g.:
public class MyKeyAttribute extends KeyAttribute { ... // the key attribute id: public static final ObjectID keyAttrID = ...; ... } ... // register the implementation: OtherKeyAttribute.register(MyKeyAttribute.keyAttrID, MyKeyAttribute.class);When implementing a key attribute by extensing this class please be aware that methods
toASN1Object
and decode
only have to convert the key attribute itsself (and NOT the keyAttrID) into
respectively from an ASN1Object.
OtherKeyAttribute
Constructor Summary | |
---|---|
KeyAttribute()
|
Method Summary | |
---|---|
abstract void |
decode(ASN1Object obj)
Decodes a key attribute from its ASN.1 representation. |
abstract boolean |
equals(java.lang.Object obj)
Checks if the supplied object equals this KeyAttribute. |
abstract ObjectID |
getKeyAttributeID()
Returns the key attribute ID identifying this key attribute. |
java.lang.String |
getName()
Returns the name of the key attribute. |
abstract int |
hashCode()
Returns the hash code of the key attribute. |
abstract ASN1Object |
toASN1Object()
Returns an ASN.1 representation of a particular key attribute. |
abstract java.lang.String |
toString()
Returns a String representation of the key attribute. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public KeyAttribute()
Method Detail |
---|
public abstract void decode(ASN1Object obj) throws CodingException
OtherKeyAttribute
class when parsing the ASN.1 representation
of a key attribute. This method only expects the ASN.1 representation
of the key attribute, but not the corresponding key attribute ID. This
method shall not be explicitly called by an application.
obj
- the key attribute as ASN1Object
CodingException
- if the ASN1Object cannot be parsedpublic abstract ASN1Object toASN1Object()
The ASN1Object returned by this method only represents the key attribute but does not include the corresponding key attribute id.
public abstract ObjectID getKeyAttributeID()
public abstract java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getName()
public abstract boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to be compared with this KeyAttribute
true
if the two KeyAttributes are equal,
false
if notpublic abstract int hashCode()
hashCode
in class java.lang.Object
|
This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |