Trying pkcs11.installmodule() Webextension Api


(Vishalbj) #1

Hi,

While testing my new signed add-on, Mozilla was able to add extension automatically, but the PKCS11 api installmodule() called in my background script is reporting the following error

Error: No such PKCS#11 module acpkcs211

Following are the files implemented as part of the add-on and their registry settings.

manifest.json

{
“name”: “ActivClient Security Module”,
“manifest_version”: 2,
“version”: “1.1”,
“description”: “ActivClient Security Module”,
“applications”: {
“gecko”: {
“id”: “{2faa6adf-08f5-418f-b6cf-b303bb71d2f1}”,
“strict_min_version”: “64.0”
}
},
“permissions”: [“pkcs11”],
“background”: {
“scripts”: [“ActivClient-Security-Module.js”]
}
}

ActivClient-Security-Module.js:

try
{
browser.pkcs11.installModule(“acpkcs211”);
console.log(“module installed”);
}
catch(e)
{
console.log("module could not be installed "+e);
}

activclient_security_module.json
{
“name”: “acpkcs211”,
“type”: “pkcs11”,
“description”: “ActivClient Security Module”,
“path”: “C:\Program Files\HID Global\ActivClient\acpkcs211.dll”,
“allowed_extensions”: ["{2faa6adf-08f5-418f-b6cf-b303bb71d2f1}"]
}

Registry settings:

HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Firefox\PKCS11Modules\acpkcs211 = C:\Program Files\HID Global\ActivClient\Mozilla Extensions\ActivClient PKCS #11 Security Module\activclient_security_module.json

Please let me know if i am missing something here.

Thank you,
Vishal