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 native 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 native 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

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxOperaFirefox for Android
getModuleSlots
Non-standard
Chrome No support NoEdge No support NoFirefox Full support 58Opera No support NoFirefox Android No support No
installModule
Non-standard
Chrome No support NoEdge No support NoFirefox Full support 58Opera No support NoFirefox Android No support No
isModuleInstalled
Non-standard
Chrome No support NoEdge No support NoFirefox Full support 58Opera No support NoFirefox Android No support No
uninstallModule
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.

Document Tags and Contributors

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