|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object iaik.cms.OtherKeyAttribute
public class OtherKeyAttribute
This class implements the CMS OtherKeyAttribute type.
The Cryptographic Message Syntax (CMS) (RFC 5652) specifies the OtherKeyAttribute type for supplying additional information to be used for key identification. Generally the usage of the OtherKeyAttribute type should be avoided. The ASN.1 structure consists of an object identifier and an optional key attribute identified by the object identifier (key attribute ID):
OtherKeyAttribute ::= SEQUENCE { keyAttrId OBJECT IDENTIFIER, keyAttr ANY DEFINED BY keyAttrId OPTIONAL }This class includes a static part to be used for registering implementations for particular key attributes. A key attribute may be implemented by extending the abstract
KeyAttribute
class and registering it by
calling the static register
method, 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);Key Attributes for which no implementation have been registered are treated as
unknown
key attributes.
KeyAttribute
,
UnknownKeyAttribute
Constructor Summary | |
---|---|
OtherKeyAttribute()
Default Constructor. |
|
OtherKeyAttribute(ASN1Object obj)
Creates an OtherKeyAttribute from an ASN1Object. |
|
OtherKeyAttribute(KeyAttribute keyAttribute)
Creates an OtherKeyAttribute from the supplied KeyAttribute. |
|
OtherKeyAttribute(ObjectID keyAttrID)
Creates an OtherKeyAttribute for the supplied key attribute ID. |
Method Summary | |
---|---|
static KeyAttribute |
create(ObjectID keyAttrID)
Returns the implementation of the key attribute defined through an ASN.1 ObjectID. |
void |
decode(ASN1Object obj)
Decodes an OtherKeyAttribute from its ASN.1 representation. |
boolean |
equals(java.lang.Object obj)
Compares this OtherKeyAttribute to the specified object. |
KeyAttribute |
getKeyAttribute()
Gets the KeyAttribute component of this OtherKeyAttribute. |
ObjectID |
getKeyAttributeID()
Gets the key attribute ID of this OtherKeyAttribute. |
int |
hashCode()
Returns a hashcode for this object. |
static void |
register(ObjectID keyAttrID,
java.lang.Class cl)
Registers a new implementation for a key attribute. |
ASN1Object |
toASN1Object()
Returns this OtherKeyAttribute as ASN1Object. |
java.lang.String |
toString()
Returns a String representation of this OtherKeyAttribute. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public OtherKeyAttribute()
public OtherKeyAttribute(ObjectID keyAttrID)
keyAttrID
- the key attribute ID of this OtherKeyAttributepublic OtherKeyAttribute(KeyAttribute keyAttribute)
keyAttribute
- the KeyAttribute component of this OtherKeyAttributepublic OtherKeyAttribute(ASN1Object obj) throws CodingException
obj
- the OtherKeyAttribute as ASN1Object
CodingException
- if the ASN1Object cannot be parsedMethod Detail |
---|
public static KeyAttribute create(ObjectID keyAttrID) throws java.lang.InstantiationException
This method belongs to the static part of this class.
keyAttrID
- the ObjectID of the key attribute.
java.lang.InstantiationException
- if the internal factory
could not create an instance of requested typepublic static void register(ObjectID keyAttrID, java.lang.Class cl)
keyAttrID
- the key attribute ID of the key attribute to be registeredcl
- the class which implements this key attributepublic KeyAttribute getKeyAttribute()
public ObjectID getKeyAttributeID()
public void decode(ASN1Object obj) throws CodingException
UnknownKeyAttribute
object is created for the unknown KeyAttribute
allowing to query for information about the KeyAttribute.
decode
in interface ASN1Type
obj
- the OtherKeyAttribute as ASN1Object
CodingException
- if the ASN1Object cannot be parsedpublic ASN1Object toASN1Object()
toASN1Object
in interface ASN1Type
public boolean equals(java.lang.Object obj)
OtherKeyAttribute
to the specified object.
equals
in class java.lang.Object
obj
- the object to compare this OtherKeyAttribute
against.
true
, if the given object is equal to this
OtherKeyAttribute
,
false
otherwisepublic int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
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 |