public abstract class KeyAttribute
extends java.lang.Object
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 and Description |
---|
KeyAttribute() |
Modifier and Type | Method and Description |
---|---|
abstract void |
decode(iaik.asn1.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 iaik.asn1.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 iaik.asn1.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.
|
public abstract void decode(iaik.asn1.ASN1Object obj) throws iaik.asn1.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 ASN1Objectiaik.asn1.CodingException
- if the ASN1Object cannot be parsedpublic abstract iaik.asn1.ASN1Object toASN1Object()
The ASN1Object returned by this method only represents the key attribute but does not include the corresponding key attribute id.
public abstract iaik.asn1.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 KeyAttributetrue
if the two KeyAttributes are equal,
false
if notpublic abstract int hashCode()
hashCode
in class java.lang.Object