public class TokenInfo
extends java.lang.Object
The structure is defined as follows:
typedef struct CK_TOKEN_INFO {
CK_UTF8CHAR label[32];
CK_UTF8CHAR manufacturerID[32];
CK_UTF8CHAR model[16];
CK_CHAR serialNumber[16];
CK_FLAGS flags;
CK_ULONG ulMaxSessionCount;
CK_ULONG ulSessionCount;
CK_ULONG ulMaxRwSessionCount;
CK_ULONG ulRwSessionCount;
CK_ULONG ulMaxPinLen;
CK_ULONG ulMinPinLen;
CK_ULONG ulTotalPublicMemory;
CK_ULONG ulFreePublicMemory;
CK_ULONG ulTotalPrivateMemory;
CK_ULONG ulFreePrivateMemory;
CK_VERSION hardwareVersion;
CK_VERSION firmwareVersion;
CK_CHAR utcTime[16];
} CK_TOKEN_INFO;
| Modifier and Type | Field and Description |
|---|---|
static long |
CKF_CLOCK_ON_TOKEN
Indicates the token has its own hardware clock.
|
static long |
CKF_DUAL_CRYPTO_OPERATIONS
Indicates that a single session with the token can perform dual
cryptographic operations.
|
static long |
CKF_LOGIN_REQUIRED
Indicates there are some cryptographic functions that a user must be
logged in to perform.
|
static long |
CKF_PROTECTED_AUTHENTICATION_PATH
Indicates the token has a "protected authentication path", whereby a
user can log into the token without passing a PIN through the Cryptoki
library.
|
static long |
CKF_RESTORE_KEY_NOT_NEEDED
Indicates that a successful save of a session's cryptographic operations
state always contains all keys needed to restore the state of the
session.
|
static long |
CKF_RNG
Indicates the token has its own random number generator.
|
static long |
CKF_SECONDARY_AUTHENTICATION
Indicates the token supports secondary authentication for private key
objects.
|
static long |
CKF_SO_PIN_COUNT_LOW
Indicates an incorrect SO login PIN has been entered at least once since
the last successful authentication.
|
static long |
CKF_SO_PIN_FINAL_TRY
Indicates that supplying an incorrect SO PIN will force the PIN to become
locked.
|
static long |
CKF_SO_PIN_LOCKED
Indicates the SO PIN has been locked - SO login to the token is not
possible.
|
static long |
CKF_SO_PIN_TO_BE_CHANGED
Indicates the SO PIN value is the default value set by token
initialization or manufacturing.
|
static long |
CKF_TOKEN_INITIALIZED
Indicates the token has been initialized.
|
static long |
CKF_USER_PIN_COUNT_LOW
Indicates an incorrect user login PIN has been entered at least once
since the last successful authentication.
|
static long |
CKF_USER_PIN_FINAL_TRY
Indicates that supplying an incorrect user PIN will force the PIN to
become locked.
|
static long |
CKF_USER_PIN_INITIALIZED
Indicates the normal user's PIN has been initialized.
|
static long |
CKF_USER_PIN_LOCKED
Indicates the user PIN has been locked - user login to the token is not
possible.
|
static long |
CKF_USER_PIN_TO_BE_CHANGED
Indicates the user PIN value is the default value set by token
initialization or manufacturing.
|
static long |
CKF_WRITE_PROTECTED
Inidcates the token is write-protected.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
dualCryptoOperationsSupported()
Deprecated.
use
isFlagSet( TokenInfo.CKF_DUAL_CRYPTO_OPERATIONS )
instead, since JTK 6.1 |
java.lang.String |
getFirmwareVersion()
Returns the firmware version component.
|
long |
getFlags()
Returns the flags component.
|
long |
getFreePrivateMemory()
Returns the free private memory component.
|
long |
getFreePublicMemory()
Returns the free public memory component.
|
java.lang.String |
getHardwareVersion()
Returns the hardware version component.
|
java.lang.String |
getLabel()
Returns the label component.
|
java.lang.String |
getManufacturerID()
Returns the manufacturer ID component.
|
long |
getMaxPinLen()
Returns the maximuim PIN length component.
|
long |
getMaxRwSessionCount()
Returns the maximum read/write session count component.
|
long |
getMaxSessionCount()
Returns the maximum session count component.
|
long |
getMinPinLen()
Returns the minimuim PIN length component.
|
java.lang.String |
getModel()
Returns the model component.
|
long |
getRwSessionCount()
Returns the read/write session count component.
|
java.lang.String |
getSerialNumber()
Returns the serial number component.
|
long |
getSessionCount()
Returns the session count component.
|
long |
getTotalPrivateMemory()
Returns the total private memory component.
|
long |
getTotalPublicMemory()
Returns the total public memory component.
|
java.lang.String |
getUtcTime()
Returns the UTC time component.
|
boolean |
hasProtAuthPath()
Deprecated.
use
isFlagSet( TokenInfo.CKF_PROTECTED_AUTHENTICATION_PATH )
instead, since JTK 6.1 |
boolean |
isClockOnToken()
Deprecated.
use
isFlagSet( TokenInfo.CKF_CLOCK_ON_TOKEN ) instead,
since JTK 6.1 |
boolean |
isFlagSet(long flag)
Indicates whether a given flag has been set.
|
boolean |
isLoginRequired()
Deprecated.
use
isFlagSet( TokenInfo.CKF_LOGIN_REQUIRED ) instead,
since JTK 6.1 |
boolean |
isRestoreKeyNotNeeded()
Deprecated.
use
isFlagSet( TokenInfo.CKF_RESTORE_KEY_NOT_NEEDED )
instead, since JTK 6.1 |
boolean |
isRNGSupported()
Deprecated.
use
isFlagSet( TokenInfo.CKF_RNG ) instead, since JTK 6.1 |
boolean |
isUserPINInitialized()
Deprecated.
use
isFlagSet( TokenInfo.CKF_USER_PIN_INITIALIZED )
instead, since JTK 6.1 |
boolean |
isWriteProtected()
Deprecated.
use
isFlagSet( TokenInfo.CKF_WRITE_PROTECTED ) instead,
since JTK 6.1 |
java.lang.String |
toString()
Returns a
String representation of the TokenInfo
object. |
java.lang.String |
toString(boolean flagNames)
Returns a
String representation of the TokenInfo
object. |
public static final long CKF_RNG
public static final long CKF_WRITE_PROTECTED
public static final long CKF_LOGIN_REQUIRED
public static final long CKF_USER_PIN_INITIALIZED
public static final long CKF_RESTORE_KEY_NOT_NEEDED
public static final long CKF_CLOCK_ON_TOKEN
public static final long CKF_PROTECTED_AUTHENTICATION_PATH
public static final long CKF_DUAL_CRYPTO_OPERATIONS
public static final long CKF_TOKEN_INITIALIZED
public static final long CKF_SECONDARY_AUTHENTICATION
public static final long CKF_USER_PIN_COUNT_LOW
public static final long CKF_USER_PIN_FINAL_TRY
public static final long CKF_USER_PIN_LOCKED
public static final long CKF_USER_PIN_TO_BE_CHANGED
public static final long CKF_SO_PIN_COUNT_LOW
public static final long CKF_SO_PIN_FINAL_TRY
public static final long CKF_SO_PIN_LOCKED
public static final long CKF_SO_PIN_TO_BE_CHANGED
public java.lang.String getLabel()
public java.lang.String getManufacturerID()
public java.lang.String getModel()
public java.lang.String getSerialNumber()
public long getFlags()
public boolean isFlagSet(long flag)
flag - the flag being checkedtrue if the flag has been set, false
otherwisepublic long getMaxSessionCount()
public long getSessionCount()
public long getMaxRwSessionCount()
public long getRwSessionCount()
public long getMaxPinLen()
public long getMinPinLen()
public long getTotalPublicMemory()
public long getFreePublicMemory()
public long getTotalPrivateMemory()
public long getFreePrivateMemory()
public java.lang.String getHardwareVersion()
public java.lang.String getFirmwareVersion()
public java.lang.String getUtcTime()
The value of this field only makes sense for tokens equipped with a clock, as indicated in the token information flags.
public java.lang.String toString()
String representation of the TokenInfo
object.
toString in class java.lang.ObjectString representation of the TokenInfo
objectpublic java.lang.String toString(boolean flagNames)
String representation of the TokenInfo
object.
flagNames - indicates that the flags component should be represented as a list of
the flags that have been set; otherwise the actual flag value will be
returnedString representation of the TokenInfo
objectpublic boolean isRNGSupported()
isFlagSet( TokenInfo.CKF_RNG ) instead, since JTK 6.1CKF_RNG flag has been set.
true if the flag has been set, false
otherwisepublic boolean isWriteProtected()
isFlagSet( TokenInfo.CKF_WRITE_PROTECTED ) instead,
since JTK 6.1CKF_WRITE_PROTECTED flag has been set.
true if the flag has been set; false
otherwisepublic boolean isLoginRequired()
isFlagSet( TokenInfo.CKF_LOGIN_REQUIRED ) instead,
since JTK 6.1CKF_LOGIN_REQUIRED flag has been set.
true if the flag has been set; false
otherwisepublic boolean isUserPINInitialized()
isFlagSet( TokenInfo.CKF_USER_PIN_INITIALIZED )
instead, since JTK 6.1CKF_USER_PIN_INITIALIZED flag has been set.
true if the flag has been set, false
otherwisepublic boolean isRestoreKeyNotNeeded()
isFlagSet( TokenInfo.CKF_RESTORE_KEY_NOT_NEEDED )
instead, since JTK 6.1CKF_RESTORE_KEY_NOT_NEEDED flag has been set.
true if the flag has been set, false
otherwisepublic boolean isClockOnToken()
isFlagSet( TokenInfo.CKF_CLOCK_ON_TOKEN ) instead,
since JTK 6.1CKF_CLOCK_ON_TOKEN flag has been set.
true if the flag has been set, false
otherwisepublic boolean hasProtAuthPath()
isFlagSet( TokenInfo.CKF_PROTECTED_AUTHENTICATION_PATH )
instead, since JTK 6.1true if the flag has been set, false
otherwisepublic boolean dualCryptoOperationsSupported()
isFlagSet( TokenInfo.CKF_DUAL_CRYPTO_OPERATIONS )
instead, since JTK 6.1CKF_DUAL_CRYPTO_OPERATIONS flag has been set.
true if the flag has been set, false
otherwise