|
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.Attribute
This is the base-class for all types of attributes. In general, all PKCS#11 objects are just a collection of attributes. PKCS#11 specifies which attributes each type of objects must have. In some cases, attributes are optinal (e.g. in RSAPrivateKey). In such a case, this attribute will return false when the application calls isPresent() on this attribute. This measn, that the object does not posses this attribute (maybe even though it should, but not all drivers seem to implement the standard correctly). Handling attributes in this fashion ensures that this library can work also with drivers that are not fully compliant. Moreover, certain attributes can be sensitive; i.e. their values cannot be read, e.g. the private exponent of a RSA private key.
Constructor Summary | |
protected |
Attribute()
Empty constructor. |
protected |
Attribute(Long type)
Constructor taking the PKCS#11 type of the attribute. |
Method Summary | |
Object |
clone()
Create a (deep) clone of this object. |
boolean |
equals(Object otherObject)
True, if both attributes are not present or if both attributes are present and all other member variables are equal. |
protected static Class |
getAttributeClass(Long type)
Get the class of the given attribute type. |
protected static String |
getAttributeName(Long type)
Get the name of the given attribute type. |
protected CK_ATTRIBUTE |
getCkAttribute()
Get the CK_ATTRIBUTE object of this Attribute that contains the attribute type and value . |
protected Long |
getType()
Get the PKCS#11 type of this attribute. |
protected String |
getValueString()
Get a string representation of the value of this attribute. |
int |
hashCode()
The overriding of this method should ensure that the objects of this class work correctly in a hashtable. |
boolean |
isPresent()
Check, if this attribute is really present in the associated object. |
boolean |
isSensitive()
Check, if this attribute is sensitive in the associated object. |
protected void |
setCkAttribute(CK_ATTRIBUTE ckAttribute)
Set the CK_ATTRIBUTE of this Attribute. |
void |
setPresent(boolean present)
Set, if this attribute is really present in the associated object. |
void |
setSensitive(boolean sensitive)
Set, if this attribute is sensitive in the associated object. |
protected void |
setType(Long type)
Set the PKCS#11 type of this attribute. |
String |
toString()
Get a string representation of this attribute. |
String |
toString(boolean withName)
Get a string representation of this attribute. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final Long CLASS
public static final Long TOKEN
public static final Long PRIVATE
public static final Long LABEL
public static final Long APPLICATION
public static final Long VALUE
public static final Long OBJECT_ID
public static final Long CERTIFICATE_TYPE
public static final Long ISSUER
public static final Long SERIAL_NUMBER
public static final Long URL
public static final Long HASH_OF_SUBJECT_PUBLIC_KEY
public static final Long HASH_OF_ISSUER_PUBLIC_KEY
public static final Long JAVA_MIDP_SECURITY_DOMAIN
public static final Long AC_ISSUER
public static final Long OWNER
public static final Long ATTR_TYPES
public static final Long TRUSTED
public static final Long KEY_TYPE
public static final Long SUBJECT
public static final Long ID
public static final Long CHECK_VALUE
public static final Long CERTIFICATE_CATEGORY
public static final Long SENSITIVE
public static final Long ENCRYPT
public static final Long DECRYPT
public static final Long WRAP
public static final Long WRAP_TEMPLATE
public static final Long UNWRAP
public static final Long UNWRAP_TEMPLATE
public static final Long SIGN
public static final Long SIGN_RECOVER
public static final Long VERIFY
public static final Long VERIFY_RECOVER
public static final Long DERIVE
public static final Long START_DATE
public static final Long END_DATE
public static final Long MODULUS
public static final Long MODULUS_BITS
public static final Long PUBLIC_EXPONENT
public static final Long PRIVATE_EXPONENT
public static final Long PRIME_1
public static final Long PRIME_2
public static final Long EXPONENT_1
public static final Long EXPONENT_2
public static final Long COEFFICIENT
public static final Long PRIME
public static final Long SUBPRIME
public static final Long BASE
public static final Long PRIME_BITS
public static final Long SUB_PRIME_BITS
public static final Long VALUE_BITS
public static final Long VALUE_LEN
public static final Long EXTRACTABLE
public static final Long LOCAL
public static final Long NEVER_EXTRACTABLE
public static final Long WRAP_WITH_TRUSTED
public static final Long ALWAYS_SENSITIVE
public static final Long ALWAYS_AUTHENTICATE
public static final Long KEY_GEN_MECHANISM
public static final Long ALLOWED_MECHANISMS
public static final Long MODIFIABLE
public static final Long ECDSA_PARAMS
public static final Long EC_PARAMS
public static final Long EC_POINT
public static final Long SECONDARY_AUTH
public static final Long AUTH_PIN_FLAGS
public static final Long HW_FEATURE_TYPE
public static final Long RESET_ON_INIT
public static final Long HAS_RESET
public static final Long VENDOR_DEFINED
protected static Hashtable attributeNames_
protected static Hashtable attributeClasses_
protected boolean present_
protected boolean sensitive_
protected CK_ATTRIBUTE ckAttribute_
Constructor Detail |
protected Attribute()
protected Attribute(Long type)
type
- The PKCS'11 type of this attribute; e.g.
PKCS11Constants.CKA_PRIVATE.Method Detail |
protected static String getAttributeName(Long type)
type
- The attribute type.
protected static Class getAttributeClass(Long type)
type
- The attribute type.
public Object clone()
public void setPresent(boolean present)
present
- True, if attribute is present.public void setSensitive(boolean sensitive)
sensitive
- True, if attribute is sensitive.protected void setCkAttribute(CK_ATTRIBUTE ckAttribute)
ckAttribute
- The new CK_ATTRIBUTE of this Attribute.public boolean isPresent()
public boolean isSensitive()
protected CK_ATTRIBUTE getCkAttribute()
protected String getValueString()
public String toString()
public String toString(boolean withName)
withName
- If true, the string contains the attribute type name and
the value. If false, it just contains the value.
protected void setType(Long type)
type
- The PKCS#11 type of this attribute.protected Long getType()
public boolean equals(Object otherObject)
otherObject
- The other object to compare to.
public int hashCode()
|
IAIK PKCS#11 Wrapper version 1.2.17 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |