Package org.xipki.pkcs11.wrapper
Class TokenInfo
- java.lang.Object
-
- org.xipki.pkcs11.wrapper.TokenInfo
-
public class TokenInfo extends Object
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.- Author:
- Karl Scheibelhofer (SIC), Lijun Liao (xipki)
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTokenInfo(CK_TOKEN_INFO ckTokenInfo)Constructor taking CK_TOKEN_INFO as given returned by PKCS11.C_GetTokenInfo.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VersiongetFirmwareVersion()Get the version of the token's firmware.longgetFlags()Return the token flags.longgetFreePrivateMemory()Get the amount of free memory for private objects.longgetFreePublicMemory()Get the amount of free memory for public objects.VersiongetHardwareVersion()Get the version of the token's hardware.StringgetLabel()Get the label of this token.StringgetManufacturerID()Get the manufacturer identifier.longgetMaxPinLen()Get the maximum length for the PIN.longgetMaxRwSessionCount()Get the maximum allowed number of (open) concurrent read-write sessions.longgetMaxSessionCount()Get the maximum allowed number of (open) concurrent sessions.longgetMinPinLen()Get the minimum length for the PIN.StringgetModel()Get the model of this token.longgetRwSessionCount()Get the current number of open read-write sessions.StringgetSerialNumber()Get the serial number of this token.longgetSessionCount()Get the current number of open sessions.InstantgetTime()Get the current time of the token's clock.longgetTotalPrivateMemory()Get the total amount of memory for private objects.longgetTotalPublicMemory()Get the total amount of memory for public objects.booleanhasFlagBit(long flagMask)booleanisLoginRequired()booleanisProtectedAuthenticationPath()booleanisTokenInitialized()StringtoString()Returns the string representation of this object.StringtoString(String indent)
-
-
-
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
-
getLabel
public String getLabel()
Get the label of this token.- Returns:
- The label of this token.
-
getManufacturerID
public String getManufacturerID()
Get the manufacturer identifier.- Returns:
- A string identifying the manufacturer of this token.
-
getModel
public String getModel()
Get the model of this token.- Returns:
- A string specifying the model of this token.
-
getSerialNumber
public 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 Instant 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.
-
getFlags
public long getFlags()
Return the token flags.- Returns:
- the token flags.
-
hasFlagBit
public boolean hasFlagBit(long flagMask)
-
isProtectedAuthenticationPath
public boolean isProtectedAuthenticationPath()
-
isLoginRequired
public boolean isLoginRequired()
-
isTokenInitialized
public boolean isTokenInitialized()
-
toString
public String toString()
Returns the string representation of this object.
-
-