import * as pkcs11 from "pkcs11js"; import * as core from "./core"; import { Module, SessionFlag, Session, Token, MechanismCollection } from "./"; /** * Enumeration specifies slot flags */ export declare enum SlotFlag { /** * `true` if a token is present in the slot (e.g., a device is in the reader) */ TOKEN_PRESENT = 1, /** * `true` if the reader supports removable devices */ REMOVABLE_DEVICE = 2, /** * `true` if the slot is a hardware slot, as opposed to a software slot implementing a "soft token" */ HW_SLOT = 4 } /** * Represents PKCS#11 slot */ export declare class Slot extends core.HandleObject { /** * Character-string description of the slot */ slotDescription: string; /** * ID of the slot manufacturer */ manufacturerID: string; /** * Bits flags that provide capabilities of the slot */ flags: SlotFlag; /** * Version number of the slot's hardware */ hardwareVersion: pkcs11.Version; /** * Version number of the slot's firmware */ firmwareVersion: pkcs11.Version; /** * PKCS#11 module */ module: Module; /** * Creates a new instance of {@link Slot} * @param handle ID of token's slot * @param module PKCS#11 module * @param lib PKCS#11 library */ constructor(handle: core.Handle, module: Module, lib: pkcs11.PKCS11); /** * Returns information about token * @returns PKCS#11 token structure */ getToken(): Token; /** * Obtains a list of mechanism types supported by a token * @returns The list of {@link Mechanism} */ getMechanisms(): MechanismCollection; /** * Initializes a token * @param pin the SO's initial PIN * @param label token label * @returns Token label */ initToken(pin: string, label?: string): string; /** * Opens a session between an application and a token in a particular slot * * @param flags Indicates the type of session * @returns Opened session */ open(flags?: SessionFlag): Session; /** * Closes all sessions an application has with a token */ closeAll(): void; protected getInfo(): void; } /** * Collection of slots */ export declare class SlotCollection extends core.Collection { /** * PKCS#11 module */ module: Module; /** * Creates a new instance of {@link SlotCollection} * @param items The kist of slot handles * @param module PKCS#11 module * @param lib PKCS#11 library */ constructor(items: Buffer[], module: Module, lib: pkcs11.PKCS11); items(index: number): Slot; }