pkcs11.installModule()

Installiert das angegebene PKCS #11-Modul und macht es für Firefox verfügbar.

Dies ist eine asynchrone Funktion, die ein Promise zurückgibt.

Syntax

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

Parameter

name

string. Name des zu installierenden Moduls. Dieser muss dem name-Eigenschaft im PKCS #11-Manifest des Moduls entsprechen.

flags Optional

integer. Flags, die an das Modul übergeben werden.

Rückgabewert

Ein Promise, das ohne Argumente erfüllt wird, sobald das Modul installiert ist.

Falls das Modul nicht gefunden wurde oder ein anderer Fehler auftritt, wird das Promise mit einer Fehlermeldung abgelehnt.

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
installModule

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

Beispiele

Installiert ein Modul und listet dann seine Slots auf und die Tokens, die sie enthalten:

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

function onGotSlots(slots) {
  for (const 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);