pkcs11.installModule()

Installs the named PKCS #11 module, making it available to Firefox.

This is an asynchronous function that returns a Promise.

Syntax

var installing = browser.pkcs11.installModule(
  name,              // string
  flags              // integer
)

Parameters

name
string. Name of the module to install. This must match the name property in the PKCS #11 manifest for the module.
flagsOptional
integer. Flags to pass to the module.

Return value

A Promise that will be fulfilled with no arguments once the module is installed.

If the module could not be found or some other error occurs, the promise will be rejected with an error message.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxOperaFirefox for Android
Basic support
Non-standard
Chrome No support NoEdge No support NoFirefox Full support 58Opera No support NoFirefox Android No support No

Legend

Full support  
Full support
No support  
No support
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.

Examples

Installs a module, then lists its slots and list the tokens they contain:

function onInstalled() {
  return browser.pkcs11.getModuleSlots("my_module");
}

function onGotSlots(slots) {
  for (slot of slots) {
    console.log(`Slot: ${slot.name}`);
    if (slot.token) {
      console.log(`Contains token: ${slot.token.name}`);
    } else {
      console.log('Is empty');
    }
  }
}

browser.pkcs11.installModule("my_module")
.then(onInstalled)
.then(onGotSlots);

Document Tags and Contributors

Contributors to this page: hellosct1, wbamberg
Last updated by: hellosct1,