Package org.xipki.pkcs11.wrapper
Class SlotInfo
- java.lang.Object
-
- org.xipki.pkcs11.wrapper.SlotInfo
-
public class SlotInfo extends 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 protectedSlotInfo(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 VersiongetFirmwareVersion()Get the version of the slot's firmware.VersiongetHardwareVersion()Get the version of the slot's hardware.StringgetManufacturerID()Get an identifier for the manufacturer of this slot.StringgetSlotDescription()Get a short description of this slot.booleanisHwSlot()Indicate, if the token is a hardware device or if it is just a pure software implementation; e.g.booleanisRemovableDevice()Indicate, if the token is removable from this slot or not.booleanisTokenPresent()Indicates, if there is a token present in this slot.StringtoString()Returns the string representation of this object.StringtoString(String indent)
-
-
-
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 String getSlotDescription()
Get a short description of this slot.- Returns:
- A string describing this slot.
-
getManufacturerID
public 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 String toString()
Returns the string representation of this object.
-
-