Allow an extension to configure Firefox security devices_PCKS11

Dear all,
can you please help me with creating PKCS11 add-on?

I made three files: Native messaging manifest (manifestmessaging.json), PKCS #11 manifest (manifestpkcs.json) and background-script.js. All three files are zipped in file ‘‘AkeEidPkcs11_64.zip’’ and saved into folder: C:\webext\AkeEidPkcs11_64.

Below are scripts. Please note that ID is actually 80 digit GUID.

manifestmessaging.json

{

“name”: “AkeEidPkcs11_64”,

“description”: “my pkcs11 extension”,

“path”: “C:\\Program Files\\AKE\\eID Middleware\\pkcs11\\AkeEidPkcs11_64.dll”,

“type”: “pkcs11”,

“allowed_extensions”: [

"myextension@mycompany.fr

"

]

}

manifestpkcs.json

{

“name”: “AkeEidPkcs11_64”,

“description”: “My pkcs11 extension”,

“path”: “C:\\Program Files\\AKE\\eID Middleware\\pkcs11\\AkeEidPkcs11_64.dll”,

“type”: “pkcs11”,

“version”: “1.0”,

“manifest_version”: 2,

“background”: {

“scripts”: [

“background-script.js”

]

},

“browser_specific_settings”: {

“gecko”: {

“id”: “myextension@mycompany.fr”,

“strict_min_version”: “130.0”

}

},

“permissions”: [

“pkcs11”

]

}

background-script.js

var AkeEidPkcs11_64App = {

var: loadPKCS11 = browser.pkcs11.installModule(“AkeEidPkcs11_64”)

};

In Regedit I created two registry keys with the following name:

HKEY_CURRENT_USER\LOCAL_MACHINE\SOFTWARE\Mozilla\NativeMessagingHosts\AkeEidPkcs11_64

HKEY_CURRENT_USER\LOCAL_MACHINE\SOFTWARE\Mozilla\PKCS11Modules\AkeEidPkcs11_64

Both keys have the same path: C:\webext\AkeEidPkcs11_64.

When I load file ‘‘AkeEidPkcs11_64.zip’’ in about:debugging, Load temporary Add-on, I get message: ''File C:\webext\AkeEidPkcs11_64\AkeEidPkcs11_64.zip does not contain a valid manifest’’.

Please advise what could be a problem. Thank you.

Your extension does not contain a manifest.json file. As noted on MDN, this is the only file that an extension must contain.

Hi Dotproto,

so I should have these two json files: Native messaging manifest (manifestmessaging.json) and PKCS #11 manifest (manifestpkcs.json) join in one file called manifest.json.
And I should then zip this .json file with file ‘‘background-script.js.’’?

Ivan