The pkcs11 API enables an extension to enumerate PKCS #11 security modules, and to make them accessible to the browser as sources of keys and certificates.

To use this API you need to have the "pkcs11" permission.

Provisioning PKCS #11 modules

There are two environmental prerequisites for using this API:

  • one or more PKCS #11 modules must be installed on the user's computer
  • for each installed PKCS #11 module, there must be a JSON manifest file that enables the browser to locate the module.

Most probably, the user or device administrator would install the PKCS #11 module, and its installer would install the manifest file at the same time. Note, though, that the module and manifest can't be installed as part of the extension's own installation process.

For details about the manifest file's contents and location, see Native manifests.

Functions

pkcs11.getModuleSlots()
For each slot in a module, get its name and whether it contains a token.
pkcs11.installModule()
Installs the named PKCS #11 module.
pkcs11.isModuleInstalled()
Checks whether the named PKCS #11 module is installed.
pkcs11.uninstallModule()
Uninstalls the named PKCS #11 module.

Browser compatibility

ChromeEdgeFirefoxFirefox for AndroidOpera
getModuleSlots No No58 No No
installModule No No58 No No
isModuleInstalled No No58 No No
uninstallModule No No58 No No

Document Tags and Contributors

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