public class GenericTemplate extends PKCS11Object
PKCS11Object.ObjectClass, PKCS11Object.VendorDefinedObjectBuilderattributeTable, objectClass, objectClassNames, objectHandle, vendorObjectBuilder| Constructor and Description |
|---|
GenericTemplate()
The default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAllAttributes(PKCS11Object object)
Adds all attributes of the given object to this generic template.
|
void |
addAllPresentAttributes(PKCS11Object 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.
|
boolean |
containsAttribute(Attribute attribute)
Checks, if the given attribute 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(PKCS11Object object)
Removes all attributes of the given object from this generic template.
|
void |
removeAllPresentAttributes(PKCS11Object 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()
Returns a string representation of the current object.
|
String |
toString(boolean newline,
boolean withName,
String indent)
Returns a string representation of the current object.
|
allocateAttributes, getAttribute, getAttributeTable, getAttributeValue, getAttributeValues, getInstance, getObjectClass, getObjectClassName, getObjectHandle, getSetAttributes, getSetAttributes, getUnknownObject, getVendorDefinedObjectBuilder, putAttribute, putAttributesInTable, removeAttribute, setObjectHandle, setVendorDefinedObjectBuilderpublic GenericTemplate()
public void addAttribute(Attribute attribute)
attribute - The attribute to add to the template.public void addAllAttributes(PKCS11Object object)
object - The object that holds the attributes to add to the template.public void addAllPresentAttributes(PKCS11Object object)
object - The object that holds the attributes to add to the template.public boolean containsAttribute(Attribute attribute)
attribute - The attribute to look for.public boolean equals(Object otherObject)
equals in class PKCS11ObjectotherObject - The other object to compare to.public int hashCode()
hashCode in class PKCS11Objectpublic void readAttributes(Session session) throws TokenException
readAttributes in class PKCS11Objectsession - The session 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(PKCS11Object object)
object - The object that holds the attributes to add to the template.public void removeAllPresentAttributes(PKCS11Object 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 PKCS11Objectpublic String toString(boolean newline, boolean withName, String indent)
toString in class PKCS11Objectnewline - 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 usedCopyright © 2018. All rights reserved.