public class Certificate extends Storage
| Modifier and Type | Class and Description |
|---|---|
static interface |
Certificate.CertificateType
This interface defines the available certificate types as defined by
PKCS#11: X_509_PUBLIC_KEY, X_509_ATTRIBUTE or VENDOR_DEFINED.
|
static interface |
Certificate.VendorDefinedCertificateBuilder
If an application uses vendor defined certificates, it must implement
this interface and install such an object handler using
setVendorDefinedCertificateBuilder.
|
PKCS11Object.ObjectClass, PKCS11Object.VendorDefinedObjectBuilder| Modifier and Type | Field and Description |
|---|---|
protected LongAttribute |
certificateCategory
Categorization of the certificate:
0 = unspecified (default),
1 = token user,
2 = authority,
3 = other entity.
|
protected CertificateTypeAttribute |
certificateType
The type of this certificate.
|
protected ByteArrayAttribute |
checkValue
Checksum of this certificate.
|
protected DateAttribute |
endDate
The end date of this certificate's validity.
|
protected DateAttribute |
startDate
The start date of this certificate's validity.
|
protected BooleanAttribute |
trusted
Indicates, if this certificate can be trusted.
|
protected static Certificate.VendorDefinedCertificateBuilder |
vendorCertificateBuilder
The currently set vendor defined certificate builder, or null.
|
label, modifiable, private_, tokenattributeTable, objectClass, objectClassNames, objectHandle, vendorObjectBuilder| Modifier | Constructor and Description |
|---|---|
|
Certificate()
The default constructor.
|
protected |
Certificate(Session session,
long objectHandle)
Constructor taking the reference to the PKCS#11 module for accessing the
object's attributes, the session handle to use for reading the attribute
values and the object handle.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
allocateAttributes()
Allocates the attribute objects for this class and adds them to the
attribute table.
|
boolean |
equals(Object otherObject)
Compares all member variables of this object with the other object.
|
LongAttribute |
getCertificateCategory()
Gets the certificate category attribute of the PKCS#11 certificate.
|
LongAttribute |
getCertificateType()
Gets the certificate type attribute of the PKCS#11 certificate.
|
static String |
getCertificateTypeName(Long certificateType)
Get the given certificate type as string.
|
ByteArrayAttribute |
getCheckValue()
Gets the check value attribute of of the PKCS#11 certificate.
|
DateAttribute |
getEndDate()
Gets the end date attribute of the validity of the PKCS#11 certificate.
|
static PKCS11Object |
getInstance(Session session,
long objectHandle)
The getInstance method of the PKCS11Object class uses this method to
create an instance of a PKCS#11 certificate.
|
DateAttribute |
getStartDate()
Gets the start date attribute of the validity of the PKCS#11 certificate.
|
BooleanAttribute |
getTrusted()
Gets the trusted attribute of the PKCS#11 certificate.
|
protected static PKCS11Object |
getUnknownCertificate(Session session,
long objectHandle)
Try to create a certificate which has no or an unknown certificate type
attribute.
|
static Certificate.VendorDefinedCertificateBuilder |
getVendorDefinedCertificateBuilder()
Get the currently set vendor-defined certificate builder.
|
int |
hashCode()
The overriding of this method should ensure that the objects of this
class work correctly in a hashtable.
|
protected static void |
putAttributesInTable(Certificate object)
Put all attributes of the given object into the attributes table of this
object.
|
void |
readAttributes(Session session)
Read the values of the attributes of this object from the token.
|
static void |
setVendorDefinedCertificateBuilder(Certificate.VendorDefinedCertificateBuilder builder)
Set a vendor-defined certificate builder that should be called to create
an instance of an vendor-defined PKCS#11 certificate; i.e.
|
String |
toString()
Returns a string representation of the current object.
|
getLabel, getModifiable, getPrivate, getToken, putAttributesInTablegetAttribute, getAttributeTable, getAttributeValue, getAttributeValues, getObjectClass, getObjectClassName, getObjectHandle, getSetAttributes, getSetAttributes, getUnknownObject, getVendorDefinedObjectBuilder, putAttribute, putAttributesInTable, removeAttribute, setObjectHandle, setVendorDefinedObjectBuilder, toStringprotected static Certificate.VendorDefinedCertificateBuilder vendorCertificateBuilder
protected CertificateTypeAttribute certificateType
protected BooleanAttribute trusted
protected LongAttribute certificateCategory
protected ByteArrayAttribute checkValue
protected DateAttribute startDate
protected DateAttribute endDate
public Certificate()
protected Certificate(Session session, long objectHandle) throws TokenException
session - 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.objectHandle - The object handle as given from the PKCS#111 module.TokenException - If getting the attributes failed.public static String getCertificateTypeName(Long certificateType)
certificateType - The certificate type to get as string.public static PKCS11Object getInstance(Session session, long objectHandle) throws TokenException
session - 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.objectHandle - The object handle as given from the PKCS#111 module.TokenException - If getting the attributes failed.protected static PKCS11Object getUnknownCertificate(Session session, long objectHandle) throws TokenException
Certificate .session - 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.objectHandle - The object handle as given from the PKCS#111 module.TokenException - If no object could be created.public static void setVendorDefinedCertificateBuilder(Certificate.VendorDefinedCertificateBuilder builder)
builder - The vendor-defined certificate builder. Null to clear any
previously installed vendor-defined builder.public static Certificate.VendorDefinedCertificateBuilder getVendorDefinedCertificateBuilder()
protected static void putAttributesInTable(Certificate object)
object - The object to handle.protected void allocateAttributes()
allocateAttributes in class Storagepublic boolean equals(Object otherObject)
public LongAttribute getCertificateType()
public BooleanAttribute getTrusted()
public LongAttribute getCertificateCategory()
public ByteArrayAttribute getCheckValue()
public DateAttribute getStartDate()
public DateAttribute getEndDate()
public int hashCode()
public void readAttributes(Session session) throws TokenException
readAttributes in class Storagesession - 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.Copyright © 2022. All rights reserved.