Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| IAIK PKCS#11 Wrapper version 1.2.16
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## iaik.pkcs.pkcs11
Class TokenInfo

    java.lang.Object
      iaik.pkcs.pkcs11.TokenInfo

All Implemented Interfaces:
  Cloneable

public class TokenInfo
extends Object
implements 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.

Invariants
  (label_ <> null) and (manufacturerID_ <> null) and (model_ <> null) and (serialNumber_ <> null) and (hardwareVersion_ <> null) and (firmwareVersion_ <> null) and (time_ <> null)

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 String` | `label_` The label of this token.
`protected boolean` | `loginRequired_` True, if the token requires the user to login to perform certain operations.
`protected 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 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 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 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
`Object` | `clone()` Create a (deep) clone of this object.
`boolean` | `equals(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.
`String` | `getLabel()` Get the label of this token.
`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.
`String` | `getModel()` Get the model of this token.
`long` | `getRwSessionCount()` Get the current number of open read-write sessions.
`String` | `getSerialNumber()` Get the serial number of this token.
`long` | `getSessionCount()` Get the current number of open sessions.
`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.
`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.

  See Also:
    Constant Field Values

### 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.

  See Also:
    Constant Field Values

### label_

    protected String label_

  The label of this token.

### manufacturerID_

    protected String manufacturerID_

  The identifier of the manufacturer of this token.

### model_

    protected String model_

  The model of this token.

### serialNumber_

    protected 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 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.
Preconditions
  (ckTokenInfo <> null)
Postconditions

Method Detail

### clone

    public Object clone()

  Create a (deep) clone of this object.

  Returns:
    A clone of this object.
  Preconditions
  Postconditions
    (result <> null) and (result instanceof TokenInfo) and (result.equals(this))

### getLabel

    public String getLabel()

  Get the label of this token.

  Returns:
    The label of this token.
  Preconditions
  Postconditions
    (result <> null)

### getManufacturerID

    public String getManufacturerID()

  Get the manufacturer identifier.

  Returns:
    A string identifying the manufacturer of this token.
  Preconditions
  Postconditions
    (result <> null)

### getModel

    public String getModel()

  Get the model of this token.

  Returns:
    A string specifying the model of this token.
  Preconditions
  Postconditions
    (result <> null)

### getSerialNumber

    public String getSerialNumber()

  Get the serial number of this token.

  Returns:
    A string holding the serial number of this token.
  Preconditions
  Postconditions
    (result <> null)

### getMaxSessionCount

    public long getMaxSessionCount()

  Get the maximum allowed number of (open) concurrent sessions.

  Returns:
    The maximum allowed number of (open) concurrent sessions.
  Preconditions
  Postconditions

### getSessionCount

    public long getSessionCount()

  Get the current number of open sessions.

  Returns:
    The current number of open sessions.
  Preconditions
  Postconditions

### 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.
  Preconditions
  Postconditions

### getRwSessionCount

    public long getRwSessionCount()

  Get the current number of open read-write sessions.

  Returns:
    The current number of open read-write sessions.
  Preconditions
  Postconditions

### getMaxPinLen

    public long getMaxPinLen()

  Get the maximum length for the PIN.

  Returns:
    The maximum length for the PIN.
  Preconditions
  Postconditions

### getMinPinLen

    public long getMinPinLen()

  Get the minimum length for the PIN.

  Returns:
    The minimum length for the PIN.
  Preconditions
  Postconditions

### getTotalPublicMemory

    public long getTotalPublicMemory()

  Get the total amount of memory for public objects.

  Returns:
    The total amount of memory for public objects.
  Preconditions
  Postconditions

### getFreePublicMemory

    public long getFreePublicMemory()

  Get the amount of free memory for public objects.

  Returns:
    The amount of free memory for public objects.
  Preconditions
  Postconditions

### getTotalPrivateMemory

    public long getTotalPrivateMemory()

  Get the total amount of memory for private objects.

  Returns:
    The total amount of memory for private objects.
  Preconditions
  Postconditions

### getFreePrivateMemory

    public long getFreePrivateMemory()

  Get the amount of free memory for private objects.

  Returns:
    The amount of free memory for private objects.
  Preconditions
  Postconditions

### getHardwareVersion

    public Version getHardwareVersion()

  Get the version of the token's hardware.

  Returns:
    The version of the token's hardware.
  Preconditions
  Postconditions
    (result <> null)

### getFirmwareVersion

    public Version getFirmwareVersion()

  Get the version of the token's firmware.

  Returns:
    The version of the token's firmware.
  Preconditions
  Postconditions
    (result <> null)

### getTime

    public 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()`
  Preconditions
  Postconditions
    (result <> null)

### 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.
  Preconditions
  Postconditions

### isWriteProtected

    public boolean isWriteProtected()

  Check, if the token is write protected.

  Returns:
    True, if the token is write protected. False, otherwise.
  Preconditions
  Postconditions

### 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.
  Preconditions
  Postconditions

### isUserPinInitialized

    public boolean isUserPinInitialized()

  Check, if the user-PIN is already initialized.

  Returns:
    True, if the user-PIN is already initialized. False, otherwise.
  Preconditions
  Postconditions

### 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.
  Preconditions
  Postconditions

### isClockOnToken

    public boolean isClockOnToken()

  Check, if the token has an own clock.

  Returns:
    True, if the token has its own clock. False, otherwise.
  Preconditions
  Postconditions

### 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.
  Preconditions
  Postconditions

### isDualCryptoOperations

    public boolean isDualCryptoOperations()

  Check, if the token supports dual crypto operations.

  Returns:
    True, if the token supports dual crypto operations. False, otherwise.
  Preconditions
  Postconditions

### isTokenInitialized

    public boolean isTokenInitialized()

  Check, if the token is already initialized.

  Returns:
    True, if the token is already initialized. False, otherwise.
  Preconditions
  Postconditions

### 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.
  Preconditions
  Postconditions

### 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.
  Preconditions
  Postconditions

### 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.
  Preconditions
  Postconditions

### isUserPinLocked

    public boolean isUserPinLocked()

  Check, if the user-PIN is locked.

  Returns:
    True, if the user-PIN is locked. False, otherwise.
  Preconditions
  Postconditions

### 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.
  Preconditions
  Postconditions

### 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.
  Preconditions
  Postconditions

### 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.
  Preconditions
  Postconditions

### isSoPinLocked

    public boolean isSoPinLocked()

  Check, if the security officer-PIN is locked.

  Returns:
    True, if the security officer-PIN is locked. False, otherwise.
  Preconditions
  Postconditions

### 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.
  Preconditions
  Postconditions

### toString

    public String toString()

  Returns the string representation of this object.

  Returns:
    the string representation of object

### equals

    public boolean equals(Object otherObject)

  Compares all member variables of this object with the other object. Returns only true, if all are equal in both objects.

  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.
  Preconditions
  Postconditions

### hashCode

    public int hashCode()

  The overriding of this method should ensure that the objects of this class work correctly in a hashtable.

  Returns:
    The hash code of this object. Gained from the label_, manufacturerID_, model_ and serialNumber_.
  Preconditions
  Postconditions

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| IAIK PKCS#11 Wrapper version 1.2.16
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

IAIK JavaSecurity Website http://jce.iaik.tugraz.at/
IAIK at Graz University of Technology, Austria, Europe
Copyright 2001-2002, IAIK, Graz University of Technology, Inffeldgasse 16a, 8010 Graz, Austria. All Rights Reserved.