Represents a PKCS#11 session. A session is used to interact with a token.
Summary
Types
The handle of the session.
The PKCS#11 module that the session belongs to.
Information about a PKCS#11 session, as returned by P11ex.Lib.session_info/1.
Corresponds to the PKCS#11 CK_SESSION_INFO structure.
The slot identifier of the session.
A struct representing a PKCS#11 session.
Functions
Create a new session handle.
Types
@type handle() :: non_neg_integer()
The handle of the session.
@type pkcs11_module() :: P11ex.Lib.ModuleHandle.t()
The PKCS#11 module that the session belongs to.
@type session_info() :: %{ slot_id: slot_id(), state: MapSet.t(atom()), flags: MapSet.t(atom()), device_error: non_neg_integer() }
Information about a PKCS#11 session, as returned by P11ex.Lib.session_info/1.
Corresponds to the PKCS#11 CK_SESSION_INFO structure.
Fields:
slot_id(non_neg_integer()): The slot that the session is bound to.state(MapSet.t(atom())): The session state flags, seeP11ex.Flagsfor the recognized session state flags.flags(MapSet.t(atom())): The flags the session was opened with, seeP11ex.Flagsfor the recognized session flags.device_error(non_neg_integer()): A device-specific error code, or0if the last operation on the token was successful.
@type slot_id() :: non_neg_integer()
The slot identifier of the session.
@type t() :: %P11ex.Lib.SessionHandle{ handle: handle(), module: pkcs11_module(), slot_id: slot_id() }
A struct representing a PKCS#11 session.
Functions
@spec new(pkcs11_module(), handle(), slot_id()) :: t()
Create a new session handle.