public abstract class Attribute
extends java.lang.Object
In some cases, attributes are optional. In such a case, this attribute will return false when the application calls present() on this attribute. This means, that the object does not possess 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 standard-compliant.
Moreover, certain attributes can be sensitive; i.e. their values cannot be read, e.g. the private exponent of an RSA private key.
| Modifier and Type | Field and Description |
|---|---|
protected sun.security.pkcs11.wrapper.CK_ATTRIBUTE |
ckAttribute
The CK_ATTRIBUTE that is used to hold the PKCS#11 type of this attribute
and the value.
|
protected boolean |
present
True, if the object really possesses this attribute.
|
protected boolean |
sensitive
True, if this attribute is sensitive.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Attribute(long type)
Constructor taking the PKCS#11 type of the attribute.
|
| Modifier and Type | Method and Description |
|---|---|
Attribute |
ckAttribute(sun.security.pkcs11.wrapper.CK_ATTRIBUTE ckAttribute)
Set the CK_ATTRIBUTE of this Attribute.
|
sun.security.pkcs11.wrapper.CK_ATTRIBUTE |
getCkAttribute()
Get the CK_ATTRIBUTE object of this Attribute that contains the attribute
type and value .
|
static Attribute |
getInstance(long type) |
static Attribute |
getInstance(long type,
java.lang.Object value) |
long |
getType()
Get the PKCS#11 type of this attribute.
|
abstract java.lang.Object |
getValue() |
protected java.lang.String |
getValueString()
Get a string representation of the value of this attribute.
|
protected boolean |
isNullValue() |
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.
|
Attribute |
present(boolean present)
Set, if this attribute is really present in the associated object.
|
Attribute |
sensitive(boolean sensitive)
Set, if this attribute is sensitive in the associated object.
|
java.lang.String |
toString()
Get a string representation of this attribute.
|
java.lang.String |
toString(boolean withName,
java.lang.String indent)
Get a string representation of this attribute.
|
long |
type() |
protected boolean present
protected boolean sensitive
protected sun.security.pkcs11.wrapper.CK_ATTRIBUTE ckAttribute
protected Attribute(long type)
type - The PKCS#11 type of this attribute; e.g. CKA_PRIVATE.public abstract java.lang.Object getValue()
public static Attribute getInstance(long type)
public static Attribute getInstance(long type, java.lang.Object value)
public Attribute present(boolean present)
present - True, if attribute is present.public Attribute sensitive(boolean sensitive)
sensitive - True, if attribute is sensitive.public Attribute ckAttribute(sun.security.pkcs11.wrapper.CK_ATTRIBUTE ckAttribute)
ckAttribute - The new CK_ATTRIBUTE of this Attribute.public boolean isPresent()
public boolean isSensitive()
public sun.security.pkcs11.wrapper.CK_ATTRIBUTE getCkAttribute()
public long type()
protected java.lang.String getValueString()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(boolean withName,
java.lang.String indent)
withName - If true, the string contains the attribute type name and the
value. If false, it just contains the value.indent - The indent.public long getType()
protected boolean isNullValue()
Copyright © 2023. All rights reserved.