/** * Returns the string representation of this object. * * @return the string representation of object */ @Override public String toString() { return Util.concatObjectsCap(200, "Slot Description: ", slotDescription, "\nManufacturer ID: ", manufacturerID, "\nHardware Version: ", hardwareVersion, "\nFirmware Version: ", firmwareVersion, "\nFlags: 0X", Util.toFullHex(flags), "\nToken present: ", isTokenPresent(), "\nRemovable Device: ", isRemovableDevice(), "\nHardware Slot: ", isHwSlot()); }
/** * Get an object for handling the token that is currently present in this * slot, or null, if there is no token present. * * @return The object for accessing the token. Or null, if none is present * in this slot. * @exception TokenException * If determining if a token is present fails. * @preconditions * @postconditions */ public Token getToken() throws TokenException { Token token = null; if (getSlotInfo().isTokenPresent()) { token = new Token(this); } return token; }
/** * Get information about this slot object. * * @return An object that contains information about this slot. * @exception TokenException * If reading the information fails. * @preconditions * @postconditions (result <> null) */ public SlotInfo getSlotInfo() throws TokenException { CK_SLOT_INFO ckSlotInfo; try { ckSlotInfo = module.getPKCS11Module().C_GetSlotInfo(slotID); } catch (sun.security.pkcs11.wrapper.PKCS11Exception ex) { throw new PKCS11Exception(ex); } return new SlotInfo(ckSlotInfo); }
if (!slotInfo.isTokenPresent()) { slotList[i] = null; LOG.info("ignore slot[{}] (id={} without token", i, slot.getSlotID());
if (!slotInfo.isTokenPresent()) { slotList[i] = null; LOG.info("ignore slot[{}] (id={} without token", i, slot.getSlotID());