Class 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 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.
        Overrides:
        toString in class Object
        Returns:
        the string representation of object