Class SlotInfo


  • public class SlotInfo
    extends java.lang.Object
    Objects of this call provide information about a slot. A slot can be a smart card reader, for instance. Notice that this object is immutable; i.e. it gets its state at object creation and does not alter afterwards. Thus, all information this object provides, is a snapshot at the object creation. This is especially important when calling isTokenPresent().
    Author:
    Karl Scheibelhofer (SIC), Lijun Liao (xipki)
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected SlotInfo​(CK_SLOT_INFO ckSlotInfo)
      Constructor that takes the CK_SLOT_INFO object as given by PKCS11.C_GetSlotInfo().
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Version getFirmwareVersion()
      Get the version of the slot's firmware.
      Version getHardwareVersion()
      Get the version of the slot's hardware.
      java.lang.String getManufacturerID()
      Get an identifier for the manufacturer of this slot.
      java.lang.String getSlotDescription()
      Get a short description of this slot.
      boolean isHwSlot()
      Indicate, if the token is a hardware device or if it is just a pure software implementation; e.g.
      boolean isRemovableDevice()
      Indicate, if the token is removable from this slot or not.
      boolean isTokenPresent()
      Indicates, if there is a token present in this slot.
      java.lang.String toString()
      Returns the string representation of this object.
      java.lang.String toString​(java.lang.String indent)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SlotInfo

        protected SlotInfo​(CK_SLOT_INFO ckSlotInfo)
        Constructor that takes the CK_SLOT_INFO object as given by PKCS11.C_GetSlotInfo().
        Parameters:
        ckSlotInfo - The CK_SLOT_INFO object as given by PKCS11.C_GetSlotInfo().
    • Method Detail

      • getSlotDescription

        public java.lang.String getSlotDescription()
        Get a short description of this slot.
        Returns:
        A string describing this slot.
      • getManufacturerID

        public java.lang.String getManufacturerID()
        Get an identifier for the manufacturer of this slot.
        Returns:
        A string identifying the manufacturer of this slot.
      • getHardwareVersion

        public Version getHardwareVersion()
        Get the version of the slot's hardware.
        Returns:
        The version of the hardware of this slot.
      • getFirmwareVersion

        public Version getFirmwareVersion()
        Get the version of the slot's firmware.
        Returns:
        The version of the firmware of this slot.
      • isTokenPresent

        public boolean isTokenPresent()
        Indicates, if there is a token present in this slot. Notice, that this refers to the time this object was created and not when this method is invoked.
        Returns:
        True, if there is a (compatible) token in the slot. False, otherwise.
      • isRemovableDevice

        public boolean isRemovableDevice()
        Indicate, if the token is removable from this slot or not. In some cases slot and token will be one device.
        Returns:
        True, if the tokens are removable. False, otherwise.
      • isHwSlot

        public boolean isHwSlot()
        Indicate, if the token is a hardware device or if it is just a pure software implementation; e.g. in case of a pure software token.
        Returns:
        True, if it is a hardware slot. 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
      • toString

        public java.lang.String toString​(java.lang.String indent)