|
IAIK PKCS#11 Wrapper version 1.2.17 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectiaik.pkcs.pkcs11.objects.Object
iaik.pkcs.pkcs11.objects.GenericTemplate
An object of this class is a generic template. Its purpose is to serve as a container for a set of attributes that the application can use to search for objects. This can be especially useful, if an application wants to search for objects in a very restricted manner. For instance, if an application wants to find all objects which contain an ID attribute with an given value, it can use this class. If it would use the Key class, it would only find Key objects. Moreover, objects of this class may serve as templates for object creation and key and key-pair generation.
Nested Class Summary |
Nested classes inherited from class iaik.pkcs.pkcs11.objects.Object |
Object.ObjectClass, Object.VendorDefinedObjectBuilder |
Field Summary |
Fields inherited from class iaik.pkcs.pkcs11.objects.Object |
attributeTable_, objectClass_, objectClassNames_, objectHandle_, vendorObjectBuilder_ |
Constructor Summary | |
GenericTemplate()
The default constructor. |
Method Summary | |
void |
addAllAttributes(Object object)
Adds all attributes of the given object to this generic template. |
void |
addAllPresentAttributes(Object object)
Adds all attributes of the given object which have their present flag set to this generic template. |
void |
addAttribute(Attribute attribute)
Adds an attribute to this generic search template. |
Object |
clone()
Create a (deep) clone of this object. |
boolean |
containsAttribute(Attribute attribute)
Checks, if the given attributte is in this template. |
boolean |
equals(Object otherObject)
Compares all member variables of this object with the other object. |
int |
hashCode()
The overriding of this method should ensure that the objects of this class work correctly in a hashtable. |
void |
readAttributes(Session session)
Read the values of the attributes of this object from the token. |
void |
removeAllAttributes(Object object)
Removes all attributes of the given object from this generic template. |
void |
removeAllPresentAttributes(Object object)
Removes all attributes of the given object which have their present flag set from this generic template. |
Attribute |
removeAttribute(Attribute attribute)
Removes the given attribute from the template. |
protected void |
setAllPresentFlags(boolean present)
Set the present flags of all attributes of this object to the given value. |
String |
toString()
This method returns a string representation of the current object. |
String |
toString(boolean newline,
boolean withName,
String indent)
This method returns a string representation of the current object. |
Methods inherited from class iaik.pkcs.pkcs11.objects.Object |
allocateAttributes, getAttributeTable, getAttributeValue, getAttributeValues, getInstance, getObjectClass, getObjectClassName, getObjectHandle, getSetAttributes, getSetAttributes, getUnknownObject, getVendorDefinedObjectBuilder, putAttributesInTable, setObjectHandle, setVendorDefinedObjectBuilder |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public GenericTemplate()
Method Detail |
public void addAttribute(Attribute attribute)
attribute
- The attribute to add to the template.public void addAllAttributes(Object object)
object
- The object that holds the attributes to add to the template.public void addAllPresentAttributes(Object object)
object
- The object that holds the attributes to add to the template.public Object clone()
clone
in class Object
public boolean containsAttribute(Attribute attribute)
attribute
- The attribute to look for.
public boolean equals(Object otherObject)
equals
in class Object
otherObject
- The other object to compare to.
public int hashCode()
hashCode
in class Object
public void readAttributes(Session session) throws TokenException
readAttributes
in class Object
session
- The session handle to use for reading attributes.
This session must have the appropriate rights; i.e.
it must be a user-session, if it is a private object.
TokenException
- If getting the attributes failed.public Attribute removeAttribute(Attribute attribute)
attribute
- The attribute to remove.
public void removeAllAttributes(Object object)
object
- The object that holds the attributes to add to the template.public void removeAllPresentAttributes(Object object)
object
- The object that holds the attributes to add to the template.protected void setAllPresentFlags(boolean present)
present
- The new value for the present flags of all attributes.public String toString()
toString
in class Object
public String toString(boolean newline, boolean withName, String indent)
newline
- true if the output should start in a new linewithName
- true if the type of the attribute should be returned tooindent
- the indent to be used
|
IAIK PKCS#11 Wrapper version 1.2.17 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |