IAIK PKCS#11 Wrapper
version 1.5

iaik.pkcs.pkcs11
Class TokenInfo

java.lang.Object
  |
  +--iaik.pkcs.pkcs11.TokenInfo
All Implemented Interfaces:
java.lang.Cloneable

public class TokenInfo
extends java.lang.Object
implements java.lang.Cloneable

Objects of this class provide information about a token. Serial number, manufacturer, free memory,... . Notice that this is just a snapshot of the token's status at the time this object was created.

Version:
1.0
Author:
Karl Scheibelhofer

Field Summary
protected  boolean clockOnToken_
          True, if the token has a clock.
protected  boolean dualCryptoOperations_
          True, if the token supports dual crypto operations.
static long EFFECTIVELY_INFINITE
          This is the value which can be used for ulMaxSessionCount and ulMaxRwSessionCount to express an infinite number.
protected  Version firmwareVersion_
          The version of the firmware of this token.
protected  long freePrivateMemory_
          The amount of free memory for private objects on this token.
protected  long freePublicMemory_
          The amount of free memory for public objects on this token.
protected  Version hardwareVersion_
          The version of the hardware of this token.
protected  java.lang.String label_
          The label of this token.
protected  boolean loginRequired_
          True, if the token requires the user to login to perform certain operations.
protected  java.lang.String manufacturerID_
          The identifier of the manufacturer of this token.
protected  long maxPinLen_
          The maximum PIN length that this token allows.
protected  long maxRwSessionCount_
          Maximum number of concurrent (open) read-write sessions.
protected  long maxSessionCount_
          The maximum number of concurrent (open) sessions.
protected  long minPinLen_
          The minimum PIN length that this token allows.
protected  java.lang.String model_
          The model of this token.
protected  boolean protectedAuthenticationPath_
          True, if there are different means to authenticate the user than passing the user-PIN to a login operation.
protected  boolean restoreKeyNotNeeded_
          True, if a successful save of a session’s cryptographic operations state always contains all keys needed to restore the state of the session.
protected  boolean rng_
          True, if the token has a random numebr generator.
protected  long rwSessionCount_
          The current number of open read-write sessions.
protected  boolean secondaryAuthentication_
          True, if the token supports secondary authentication for private key objects.
protected  java.lang.String serialNumber_
          The serial number of this token.
protected  long sessionCount_
          The current number of open sessions.
protected  boolean soPinCountLow_
          True, if the security officer-PIN has been entered incorrectly at least once since the last successful authentication.
protected  boolean soPinFinalTry_
          True, if the security officer has just one try left to supply the correct PIN before the security officer-PIN gets locked.
protected  boolean soPinLocked_
          True, if the security officer-PIN is locked.
protected  boolean soPinToBeChanged_
          True, if the security officer-PIN value is the default value set by token initialization or manufacturing.
protected  java.util.Date time_
          The current time on the token.
protected  boolean tokenInitialized_
          True, if the token is already initialized.
protected  long totalPrivateMemory_
          The total amount of memory for private objects on this token.
protected  long totalPublicMemory_
          The total amount of memory for public objects on this token.
static long UNAVAILABLE_INFORMATION
          This is the value which can be used for ulMaxSessionCount, ulSessionCount, ulMaxRwSessionCount, ulRwSessionCount, ulTotalPublicMemory, ulFreePublicMemory, ulTotalPrivateMemory, and ulFreePrivateMemory to signal that the information is unavailable.
protected  boolean userPinCountLow_
          True, if the user-PIN has been entered incorrectly at least once since the last successful authentication.
protected  boolean userPinFinalTry_
          True, if the user has just one try left to supply the correct PIN before the user-PIN gets locked.
protected  boolean userPinInitialized_
          True, if the user-PIN is already initialized.
protected  boolean userPinLocked_
          True, if the user-PIN is locked.
protected  boolean userPinToBeChanged_
          True, if the user PIN value is the default value set by token initialization or manufacturing.
protected  boolean writeProtected_
          True, if the token is write protected.
 
Constructor Summary
protected TokenInfo(CK_TOKEN_INFO ckTokenInfo)
          Constructor taking CK_TOKEN_INFO as given returned by PKCS11.C_GetTokenInfo.
 
Method Summary
 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.
 Version getFirmwareVersion()
          Get the version of the token's firmware.
 long getFreePrivateMemory()
          Get the amount of free memory for private objects.
 long getFreePublicMemory()
          Get the amount of free memory for public objects.
 Version getHardwareVersion()
          Get the version of the token's hardware.
 java.lang.String getLabel()
          Get the label of this token.
 java.lang.String getManufacturerID()
          Get the manufacturer identifier.
 long getMaxPinLen()
          Get the maximum length for the PIN.
 long getMaxRwSessionCount()
          Get the maximum allowed number of (open) concurrent read-write sessions.
 long getMaxSessionCount()
          Get the maximum allowed number of (open) concurrent sessions.
 long getMinPinLen()
          Get the minimum length for the PIN.
 java.lang.String getModel()
          Get the model of this token.
 long getRwSessionCount()
          Get the current number of open read-write sessions.
 java.lang.String getSerialNumber()
          Get the serial number of this token.
 long getSessionCount()
          Get the current number of open sessions.
 java.util.Date getTime()
          Get the current time of the token's clock.
 long getTotalPrivateMemory()
          Get the total amount of memory for private objects.
 long getTotalPublicMemory()
          Get the total amount of memory for public objects.
 int hashCode()
          The overriding of this method should ensure that the objects of this class work correctly in a hashtable.
 boolean isClockOnToken()
          Check, if the token has an own clock.
 boolean isDualCryptoOperations()
          Check, if the token supports dual crypto operations.
 boolean isLoginRequired()
          Check, if the token requires the user to log in before certain operations can be performed.
 boolean isProtectedAuthenticationPath()
          Check, if the token has an protected authentication path.
 boolean isRestoreKeyNotNeeded()
          Check, if a successful save of a session’s cryptographic operations state always contains all keys needed to restore the state of the session.
 boolean isRNG()
          Check, if the token has a random number generator.
 boolean isSecondaryAuthentication()
          Check, if the token supports secondary authentication for private key objects.
 boolean isSoPinCountLow()
          Check, if the security officer-PIN has been entered incorrectly at least once since the last successful authentication.
 boolean isSoPinFinalTry()
          Check, if the security officer has just one try left to supply the correct PIN before the security officer-PIN gets locked.
 boolean isSoPinLocked()
          Check, if the security officer-PIN is locked.
 boolean isSoPinToBeChanged()
          Check, if the security officer PIN value is the default value set by token initialization or manufacturing.
 boolean isTokenInitialized()
          Check, if the token is already initialized.
 boolean isUserPinCountLow()
          Check, if the user-PIN has been entered incorrectly at least once since the last successful authentication.
 boolean isUserPinFinalTry()
          Check, if the user has just one try left to supply the correct PIN before the user-PIN gets locked.
 boolean isUserPinInitialized()
          Check, if the user-PIN is already initialized.
 boolean isUserPinLocked()
          Check, if the user-PIN is locked.
 boolean isUserPinToBeChanged()
          Check, if the user PIN value is the default value set by token initialization or manufacturing.
 boolean isWriteProtected()
          Check, if the token is write protected.
 java.lang.String toString()
          Returns the string representation of this object.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EFFECTIVELY_INFINITE

public static final long EFFECTIVELY_INFINITE
This is the value which can be used for ulMaxSessionCount and ulMaxRwSessionCount to express an infinite number.

UNAVAILABLE_INFORMATION

public static final long UNAVAILABLE_INFORMATION
This is the value which can be used for ulMaxSessionCount, ulSessionCount, ulMaxRwSessionCount, ulRwSessionCount, ulTotalPublicMemory, ulFreePublicMemory, ulTotalPrivateMemory, and ulFreePrivateMemory to signal that the information is unavailable.

label_

protected java.lang.String label_
The label of this token.

manufacturerID_

protected java.lang.String manufacturerID_
The identifier of the manufacturer of this token.

model_

protected java.lang.String model_
The model of this token.

serialNumber_

protected java.lang.String serialNumber_
The serial number of this token.

maxSessionCount_

protected long maxSessionCount_
The maximum number of concurrent (open) sessions.

sessionCount_

protected long sessionCount_
The current number of open sessions.

maxRwSessionCount_

protected long maxRwSessionCount_
Maximum number of concurrent (open) read-write sessions.

rwSessionCount_

protected long rwSessionCount_
The current number of open read-write sessions.

maxPinLen_

protected long maxPinLen_
The maximum PIN length that this token allows.

minPinLen_

protected long minPinLen_
The minimum PIN length that this token allows.

totalPublicMemory_

protected long totalPublicMemory_
The total amount of memory for public objects on this token.

freePublicMemory_

protected long freePublicMemory_
The amount of free memory for public objects on this token.

totalPrivateMemory_

protected long totalPrivateMemory_
The total amount of memory for private objects on this token.

freePrivateMemory_

protected long freePrivateMemory_
The amount of free memory for private objects on this token.

hardwareVersion_

protected Version hardwareVersion_
The version of the hardware of this token.

firmwareVersion_

protected Version firmwareVersion_
The version of the firmware of this token.

time_

protected java.util.Date time_
The current time on the token. This value only makes sense, if the token contains a clock.

rng_

protected boolean rng_
True, if the token has a random numebr generator.

writeProtected_

protected boolean writeProtected_
True, if the token is write protected.

loginRequired_

protected boolean loginRequired_
True, if the token requires the user to login to perform certain operations.

userPinInitialized_

protected boolean userPinInitialized_
True, if the user-PIN is already initialized.

restoreKeyNotNeeded_

protected boolean restoreKeyNotNeeded_
True, if a successful save of a session’s cryptographic operations state always contains all keys needed to restore the state of the session.

clockOnToken_

protected boolean clockOnToken_
True, if the token has a clock.

protectedAuthenticationPath_

protected boolean protectedAuthenticationPath_
True, if there are different means to authenticate the user than passing the user-PIN to a login operation.

dualCryptoOperations_

protected boolean dualCryptoOperations_
True, if the token supports dual crypto operations.

tokenInitialized_

protected boolean tokenInitialized_
True, if the token is already initialized.

secondaryAuthentication_

protected boolean secondaryAuthentication_
True, if the token supports secondary authentication for private key objects.

userPinCountLow_

protected boolean userPinCountLow_
True, if the user-PIN has been entered incorrectly at least once since the last successful authentication.

userPinFinalTry_

protected boolean userPinFinalTry_
True, if the user has just one try left to supply the correct PIN before the user-PIN gets locked.

userPinLocked_

protected boolean userPinLocked_
True, if the user-PIN is locked.

userPinToBeChanged_

protected boolean userPinToBeChanged_
True, if the user PIN value is the default value set by token initialization or manufacturing.

soPinCountLow_

protected boolean soPinCountLow_
True, if the security officer-PIN has been entered incorrectly at least once since the last successful authentication.

soPinFinalTry_

protected boolean soPinFinalTry_
True, if the security officer has just one try left to supply the correct PIN before the security officer-PIN gets locked.

soPinLocked_

protected boolean soPinLocked_
True, if the security officer-PIN is locked.

soPinToBeChanged_

protected boolean soPinToBeChanged_
True, if the security officer-PIN value is the default value set by token initialization or manufacturing.
Constructor Detail

TokenInfo

protected TokenInfo(CK_TOKEN_INFO ckTokenInfo)
Constructor taking CK_TOKEN_INFO as given returned by PKCS11.C_GetTokenInfo.
Parameters:
ckTokenInfo - The CK_TOKEN_INFO object as returned by PKCS11.C_GetTokenInfo.
Method Detail

clone

public java.lang.Object clone()
Create a (deep) clone of this object.
Overrides:
clone in class java.lang.Object
Returns:
A clone of this object.

getLabel

public java.lang.String getLabel()
Get the label of this token.
Returns:
The label of this token.

getManufacturerID

public java.lang.String getManufacturerID()
Get the manufacturer identifier.
Returns:
A string identifying the manufacturer of this token.

getModel

public java.lang.String getModel()
Get the model of this token.
Returns:
A string specifying the model of this token.

getSerialNumber

public java.lang.String getSerialNumber()
Get the serial number of this token.
Returns:
A string holding the serial number of this token.

getMaxSessionCount

public long getMaxSessionCount()
Get the maximum allowed number of (open) concurrent sessions.
Returns:
The maximum allowed number of (open) concurrent sessions.

getSessionCount

public long getSessionCount()
Get the current number of open sessions.
Returns:
The current number of open sessions.

getMaxRwSessionCount

public long getMaxRwSessionCount()
Get the maximum allowed number of (open) concurrent read-write sessions.
Returns:
The maximum allowed number of (open) concurrent read-write sessions.

getRwSessionCount

public long getRwSessionCount()
Get the current number of open read-write sessions.
Returns:
The current number of open read-write sessions.

getMaxPinLen

public long getMaxPinLen()
Get the maximum length for the PIN.
Returns:
The maximum length for the PIN.

getMinPinLen

public long getMinPinLen()
Get the minimum length for the PIN.
Returns:
The minimum length for the PIN.

getTotalPublicMemory

public long getTotalPublicMemory()
Get the total amount of memory for public objects.
Returns:
The total amount of memory for public objects.

getFreePublicMemory

public long getFreePublicMemory()
Get the amount of free memory for public objects.
Returns:
The amount of free memory for public objects.

getTotalPrivateMemory

public long getTotalPrivateMemory()
Get the total amount of memory for private objects.
Returns:
The total amount of memory for private objects.

getFreePrivateMemory

public long getFreePrivateMemory()
Get the amount of free memory for private objects.
Returns:
The amount of free memory for private objects.

getHardwareVersion

public Version getHardwareVersion()
Get the version of the token's hardware.
Returns:
The version of the token's hardware.

getFirmwareVersion

public Version getFirmwareVersion()
Get the version of the token's firmware.
Returns:
The version of the token's firmware.

getTime

public java.util.Date getTime()
Get the current time of the token's clock. This value does only make sense if the token has a clock. Remind that, this is the time this object was created and not the time the application called this method.
Returns:
The current time on the token's clock.
See Also:
isClockOnToken()

isRNG

public boolean isRNG()
Check, if the token has a random number generator.
Returns:
True, if the token has a random number generator. False, otherwise.

isWriteProtected

public boolean isWriteProtected()
Check, if the token is write protected.
Returns:
True, if the token is write protected. False, otherwise.

isLoginRequired

public boolean isLoginRequired()
Check, if the token requires the user to log in before certain operations can be performed.
Returns:
True, if the token requires the user to log in before certain operations can be performed. False, otherwise.

isUserPinInitialized

public boolean isUserPinInitialized()
Check, if the user-PIN is already initialized.
Returns:
True, if the user-PIN is already initialized. False, otherwise.

isRestoreKeyNotNeeded

public boolean isRestoreKeyNotNeeded()
Check, if a successful save of a session’s cryptographic operations state always contains all keys needed to restore the state of the session.
Returns:
True, if a successful save of a session’s cryptographic operations state always contains all keys needed to restore the state of the session. False, otherwise.

isClockOnToken

public boolean isClockOnToken()
Check, if the token has an own clock.
Returns:
True, if the token has its own clock. False, otherwise.

isProtectedAuthenticationPath

public boolean isProtectedAuthenticationPath()
Check, if the token has an protected authentication path. This means that a user may log in without providing a PIN to the login method, because the token has other means to authenticate the user; e.g. a PIN-pad on the reader or some biometric authentication.
Returns:
True, if the token has an protected authentication path. False, otherwise.

isDualCryptoOperations

public boolean isDualCryptoOperations()
Check, if the token supports dual crypto operations.
Returns:
True, if the token supports dual crypto operations. False, otherwise.

isTokenInitialized

public boolean isTokenInitialized()
Check, if the token is already initialized.
Returns:
True, if the token is already initialized. False, otherwise.

isSecondaryAuthentication

public boolean isSecondaryAuthentication()
Check, if the token supports secondary authentication for private key objects.
Returns:
True, if the token supports secondary authentication. False, otherwise.

isUserPinCountLow

public boolean isUserPinCountLow()
Check, if the user-PIN has been entered incorrectly at least once since the last successful authentication.
Returns:
True, if the the user-PIN has been entered incorrectly at least one since the last successful authentication. False, otherwise.

isUserPinFinalTry

public boolean isUserPinFinalTry()
Check, if the user has just one try left to supply the correct PIN before the user-PIN gets locked.
Returns:
True, if the user has just one try left to supply the correct PIN before the user-PIN gets locked. False, otherwise.

isUserPinLocked

public boolean isUserPinLocked()
Check, if the user-PIN is locked.
Returns:
True, if the user-PIN is locked. False, otherwise.

isUserPinToBeChanged

public boolean isUserPinToBeChanged()
Check, if the user PIN value is the default value set by token initialization or manufacturing.
Returns:
True, if the user PIN value is the default value set by token initialization or manufacturing. False, otherwise.

isSoPinCountLow

public boolean isSoPinCountLow()
Check, if the security officer-PIN has been entered incorrectly at least once since the last successful authentication.
Returns:
True, if the the security officer-PIN has been entered incorrectly at least one since the last successful authentication. False, otherwise.

isSoPinFinalTry

public boolean isSoPinFinalTry()
Check, if the security officer has just one try left to supply the correct PIN before the security officer-PIN gets locked.
Returns:
True, if the security officer has just one try left to supply the correct PIN before the security officer-PIN gets locked. False, otherwise.

isSoPinLocked

public boolean isSoPinLocked()
Check, if the security officer-PIN is locked.
Returns:
True, if the security officer-PIN is locked. False, otherwise.

isSoPinToBeChanged

public boolean isSoPinToBeChanged()
Check, if the security officer PIN value is the default value set by token initialization or manufacturing.
Returns:
True, if the security officer PIN value is the default value set by token initialization or manufacturing. False, otherwise.

toString

public java.lang.String toString()
Returns the string representation of this object.
Overrides:
toString in class java.lang.Object
Returns:
the string representation of object

equals

public boolean equals(java.lang.Object otherObject)
Compares all member variables of this object with the other object. Returns only true, if all are equal in both objects.
Overrides:
equals in class java.lang.Object
Parameters:
otherObject - The other TokenInfo object.
Returns:
True, if other is an instance of Info and all member variables of both objects are equal. False, otherwise.

hashCode

public int hashCode()
The overriding of this method should ensure that the objects of this class work correctly in a hashtable.
Overrides:
hashCode in class java.lang.Object
Returns:
The hash code of this object. Gained from the label_, manufacturerID_, model_ and serialNumber_.

IAIK PKCS#11 Wrapper
version 1.5

IAIK JavaSecurity Website http://jce.iaik.tugraz.at/

IAIK at Graz University of Technology, Austria, Europe
Copyright 2001-2004, IAIK, Graz University of Technology, Inffeldgasse 16a, 8010 Graz, Austria. All Rights Reserved.
version 1.5