Function: createPkcs11KeyCustodian()
createPkcs11KeyCustodian(
options):Promise<Pkcs11KeyCustodian>
Defined in: packages/key-custodian/src/pkcs11/adapter.ts:220
Starts the adapter.
Load the library once per process: PKCS#11 initialisation is process-wide, so two custodians over the same module share its state, and closing one finalises it for both.
Parameters
options
Returns
Promise<Pkcs11KeyCustodian>
Throws
When the key policy refuses this token in this
environment class: under production, any known software token. Names KeyCustodian.
Throws
invalid_request for an empty purposes, or under
production without expectedManufacturer or expectedModel, both before the
library is loaded; policy_refused when the token's manufacturer, model or serial is
not the configured one; backend_missing when the library cannot be loaded or no
token carries the label; login_failed for a refused PIN; custody_unavailable
when the module fails.