P11ex.Lib.Slot (p11ex v0.5.0)

Copy Markdown View Source

Represents a PKCS#11 slot. A slot can contain a token (e.g. a smart card) or a token emulator (e.g. a software token).

Summary

Types

The slot description.

The firmware version of the slot.

The flags of the slot. See P11ex.Flags for more information.

The hardware version of the slot.

The manufacturer ID of the slot.

The PKCS#11 module that the slot belongs to.

The slot identifier.

t()

A struct representing a PKCS#11 slot.

Information about the token present in a slot, as returned by P11ex.Lib.token_info/2. Corresponds to the PKCS#11 CK_TOKEN_INFO structure.

Types

description()

@type description() :: String.t()

The slot description.

firmware_version()

@type firmware_version() :: {non_neg_integer(), non_neg_integer()}

The firmware version of the slot.

flags()

@type flags() :: MapSet.t(atom())

The flags of the slot. See P11ex.Flags for more information.

hardware_version()

@type hardware_version() :: {non_neg_integer(), non_neg_integer()}

The hardware version of the slot.

manufacturer_id()

@type manufacturer_id() :: String.t()

The manufacturer ID of the slot.

pkcs11_module()

@type pkcs11_module() :: P11ex.Lib.ModuleHandle.t()

The PKCS#11 module that the slot belongs to.

slot_id()

@type slot_id() :: non_neg_integer()

The slot identifier.

t()

@type t() :: %P11ex.Lib.Slot{
  description: description(),
  firmware_version: firmware_version(),
  flags: flags(),
  hardware_version: hardware_version(),
  manufacturer_id: manufacturer_id(),
  module: pkcs11_module(),
  slot_id: slot_id()
}

A struct representing a PKCS#11 slot.

token_info()

@type token_info() :: %{
  label: String.t(),
  manufacturer_id: String.t(),
  model: String.t(),
  serial_number: String.t(),
  flags: MapSet.t(atom()),
  max_session_count: non_neg_integer(),
  session_count: non_neg_integer(),
  max_rw_session_count: non_neg_integer(),
  rw_session_count: non_neg_integer(),
  max_pin_len: non_neg_integer(),
  min_pin_len: non_neg_integer(),
  total_public_memory: non_neg_integer(),
  free_public_memory: non_neg_integer(),
  total_private_memory: non_neg_integer(),
  free_private_memory: non_neg_integer(),
  hardware_version: {non_neg_integer(), non_neg_integer()},
  firmware_version: {non_neg_integer(), non_neg_integer()},
  utc_time: String.t() | nil
}

Information about the token present in a slot, as returned by P11ex.Lib.token_info/2. Corresponds to the PKCS#11 CK_TOKEN_INFO structure.

Fields:

  • label (String.t()): The label of the token.
  • manufacturer_id (String.t()): The manufacturer of the token.
  • model (String.t()): The model of the token.
  • serial_number (String.t()): The serial number of the token.
  • flags (MapSet.t(atom())): The token flags, see P11ex.Flags for the recognized token flags.
  • max_session_count (non_neg_integer()): The maximum number of sessions that can be opened with the token at once.
  • session_count (non_neg_integer()): The number of sessions currently open with the token.
  • max_rw_session_count (non_neg_integer()): The maximum number of read/write sessions that can be opened with the token at once.
  • rw_session_count (non_neg_integer()): The number of read/write sessions currently open with the token.
  • max_pin_len (non_neg_integer()): The maximum length of the token's PIN.
  • min_pin_len (non_neg_integer()): The minimum length of the token's PIN.
  • total_public_memory (non_neg_integer()): The total amount of memory on the token for public objects.
  • free_public_memory (non_neg_integer()): The free amount of memory on the token for public objects.
  • total_private_memory (non_neg_integer()): The total amount of memory on the token for private objects.
  • free_private_memory (non_neg_integer()): The free amount of memory on the token for private objects.
  • hardware_version ({non_neg_integer(), non_neg_integer()}): The hardware version of the token.
  • firmware_version ({non_neg_integer(), non_neg_integer()}): The firmware version of the token.
  • utc_time (String.t() | nil): The current time on the token, if the token has a clock; nil otherwise.