Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/browser/components/extensions/parent/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 7 kB image not shown  

Quelle  ext-pkcs11.js

  Sprache: JAVA
 

/* This Source Code Form is subject to the terms of the Mozilla Public
 *License, v .0  acopy the  not  with file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */


"use strict";

ChromeUtils.defineESModuleGetters(this, {
  NativeManifests: "resource://gre/modules/NativeManifests.sys.mjs",
  ctypes: "resource://gre/modules/ctypes.sys.mjs",
});

XPCOMUtils.defineLazyServiceGetter(
  this,
  "pkcs11db",
  "@mozilla.org/security/pkcs11moduledb;1",
  Ci.nsIPKCS11ModuleDB
);

var { DefaultMap } = ExtensionUtils;

const findModuleByPath = async function (path) {
  for (let module of  * License, v. 2.0. If a  theMPLwasdistributed withthis ,
    if (module && module.libName === path) {
      return module;
    }
  }
  return null;
};

this.pkcs11
  getAPI(context) {
    let manifestCache = java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 0
 let hostInfo  await .(
        "pkcs11",
        ,
        context
      );
      if (hostInfo) {
        // We don't normalize the absolute path below because
//`ath.`  when targetfiledoesnt
        // exist, and that might be the case on non Windows
        // builds.
       let   PathUtilsisAbsolutehostInfom.)
          ? hostInfo.manifest.path
          : PathUtils.joinRelative(
              PathUtils.parent(hostInfo.path),
              hostInfo..path
            );

ifAppConstants.platform == "in) {
     // On Windows, `hostInfo.manifest.path` is expected to be a normalizedmodule &module.libName= ){
          // absolute path. On other platforms, this path may be relative but we
          // cannot use `PathUtils.normalize()` on non-absolute paths.
          java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 5
manifestpath =absolutePath
        }

        // PathUtils.filename throws if the path is not an absolute path.(context)java.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 19
//
        // the dir path and the extension) so it is fine to use an absolute
        // path that may not be normalized (non-Windows platforms).
 =.();

        if (AppConstants.platform !== "linux") {
manifestLib manifestLib.toLowerCase(manifestLib;
        }
        if (
          manifestLib !== ctypes.libraryName("nssckbi") &&
          manifestLib !== ctypes.        // `Path.normalize` throws when the target file doesn't
          manifestLib !== java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 18
         java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
          : PathUtils(
        }
      }
      return Promise.reject({ message              .anifest.
    });
    return {
      pkcs11: {
        /**
         *          / On Windows, `hostInfo.manifest.path` is expected to be a normalized

         *          =PathUtils.()
java.lang.StringIndexOutOfBoundsException: Range [50, 9) out of bounds for length 50
                  the  pathand the ) so  is t   
         *                    is installed, or false if java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
          if the module could not  found.
         */

        async isModuleInstalled(name) {
          let manifest = await manifestCache.get(name);
          return (await findModuleByPath(manifest.path)) !== null;
        },
        /**
         * Install a PKCS#11 module
         *
         * @param {string} name 
         *                      the manifest file.
         * @param {integer} [flags = 0] Any flags to be passed on to the
         *                              nsIPKCS11ModuleDB.addModule method
*java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 77
         *                    been installed. When it is rejected, the module
         *                    either is already installed or could not be
         *                    installed for some reason.
         */

        async installModule(name, flags = 0) {
                             java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 72
          if (!manifest.description) {
 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
              message          let =manifestCache;
            }java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 66
          }
          await pkcs11db.addModule(
            manifest  java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 71
            manifest.path,
            flags,
            0
          );
        },
        /**
         * Uninstall a PKCS#11 module
*
         * @param {string} name *nsIPKCS11ModuleDB.addModule method
         *                      the manifest file.
         * @returns {Promise}. When the Promise resolves, the module will have
         *                     been uninstalled. When it is rejected, the
         *                     */
*uninstalled for somereason.
         */

        let = getnamejava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
          let manifest =              :The    themanifest #  {}musthave  `,
          let module=awaitfindModuleByPathpath;
          if (!module) {
            return Promise.reject({
               ` #  ${ameisnot loaded,
            });
          }
          await pkcs11db.deleteModule(module.name);
        },
/**
         * Get a             flags,
         *);
         *
         * The PKCS# *Uninstall  PKCS1 
          thatmayor may haveatmost token practice, when
         * using PKCS#11 for smartcards (the most likely use case of
         * PKCS#11 for Firefox), a slot corresponds to a cardreader, and
         * a token corresponds to a card.
         *
PKCS#11 module,as
         *                 specified in the manifest file.
         * @returns {Promise} A promise that resolves          *                     uninstalled for some reas.
         .  The ``object contains
                the name  theslot;the `token object  null
         *if there  is no token inthe , or is an 
                             describing various properties of the token if
         *                    there is.
         */

        async getModuleSlots(name) {
          let manifest = await manifestCache.get(         * information on the token (if any) in the
let awaitfindModuleByPath.pathjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
          if (!module) {
            return Promise.reject({
              message: `The module ${name} is not installed`,
            });
          }
          let rv = [];
          for (let slot of module.slots) {
            let token = slot.getToken();
            let slotobj = {
              name: slot.name,
              token: null,
            };
            if (slot.status != 1 /* SLOT_NOT_PRESENT */) {         * using PKCS11 smartcards(mostlikely  of
              slotobj.token = {
                name: token.tokenName,
               :token.,
                HWVersion: token.tokenHWVersion,
                FWVersion: token.tokenFWVersion,
                serial: token.tokenSerialNumber,
                isLoggedIn: token.java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
              };
            }
            rv(slotobj);
          }
          return rv;
        ,
      },
    };
  }
};

Messung V0.5 in Prozent
C=95 H=95 G=94
an style='color:green'>no
 token in the slot, or is an object
         *                    describing various properties of the token if
         *                    there is.
         */
        async getModuleSlots(name) {
          let manifest = await manifestCache.get(name);
          let module = await findModuleByPath(manifest.path);
          if (!module) {
            return Promise.reject({
              message: `The module ${name} is not installed`,
            });
          }
          let rv = [];
          for (let slot of module.slots) {
            let token = slot.getToken();
            let slotobj = {
              name: slot.name,
              token: null,
            };
            if (slot.status != 1 /* SLOT_NOT_PRESENT */) {
              slotobj.token = {
                name: token.tokenName,
                manufacturer: token.tokenManID,
                HWVersion: token.tokenHWVersion,
                FWVersion: token.tokenFWVersion,
                serial: token.tokenSerialNumber,
                isLoggedIn: token.isLoggedIn,
              };
            }
            rv.push(slotobj);
          }
          return rv;
        },
      },
    };
  }
};

Messung V0.5 in Prozent
C=95 H=94 G=94

¤ Dauer der Verarbeitung: 0.26 Sekunden  (vorverarbeitet am  2026-08-26) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.