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.
|
Object.ObjectClass, Object.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_, token_
attributeTable_, 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.
|
java.lang.Object |
clone()
Create a (deep) clone of this object.
|
boolean |
equals(java.lang.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 java.lang.String |
getCertificateTypeName(java.lang.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 Object |
getInstance(Session session,
long objectHandle)
The getInstance method of the Object 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 Object |
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.
|
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.
|
java.lang.String |
toString()
This method returns a string representation of the current object.
|
getLabel, getModifiable, getPrivate, getToken, putAttributesInTable
checkAttributesState, checkAttributeState, getAttribute, getAttributeTable, getAttributeValue, getAttributeValues, getObjectClass, getObjectClassName, getObjectHandle, getSetAttributes, getSetAttributes, getUnknownObject, getVendorDefinedObjectBuilder, putAttribute, putAttributesInTable, readAttributes, removeAttribute, setObjectHandle, setVendorDefinedObjectBuilder, toString
protected 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 java.lang.String getCertificateTypeName(java.lang.Long certificateType)
certificateType
- The certificate type to get as string.public static Object 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 Object getUnknownCertificate(Session session, long objectHandle) throws TokenException
Certificate
.session
- The session to use.objectHandle
- The handle of the objectTokenException
- 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 Storage
public java.lang.Object clone()
public boolean equals(java.lang.Object otherObject)
public LongAttribute getCertificateType()
public BooleanAttribute getTrusted()
public LongAttribute getCertificateCategory()
public ByteArrayAttribute getCheckValue()
public DateAttribute getStartDate()
public DateAttribute getEndDate()
public int hashCode()
public java.lang.String toString()
IAIK JavaSecurity Website http://jce.iaik.tugraz.at/
IAIK at Graz University of Technology, Austria, Europe
Copyright 2001-2023 IAIK, Graz University of Technology, Inffeldgasse 16a, 8010 Graz, Austria. All Rights Reserved. version 1.6.9