function loadNSSCertinfo(derTestFile) {
  let allCerts = gCertDB.getCerts();
  let enumerator = allCerts.getEnumerator();
  let certNameToSKD = {};
  let certSKDToName = {};
  while (enumerator.hasMoreElements()) {
    let cert = enumerator.getNext().QueryInterface(Ci.nsIX509Cert);
    if (!isCertBuiltIn(cert)) {
      continue;
    }
    let name = cert.nickname.substr(BUILT_IN_NICK_PREFIX.length);
    let SKD = cert.sha256SubjectPublicKeyInfoDigest;
    certNameToSKD[name] = SKD;
    certSKDToName[SKD] = name;
  }
  {
    // A certificate for *.example.com.
    let der = readFileToString(derTestFile);
    let testCert = gCertDB.constructX509(der, der.length);
    // We can't include this cert in the previous loop, because it skips
    // non-builtin certs and the nickname is not built-in to the cert.
    let name = "End Entity Test Cert";
    let SKD  = testCert.sha256SubjectPublicKeyInfoDigest;
    certNameToSKD[name] = SKD;
    certSKDToName[SKD] = name;
  }
  return [certNameToSKD, certSKDToName];
}
// nicknames and digests of the SPKInfo for the mozilla trust store
nicknames and digests of the SPKInfo for the mozilla trust store
nicknames and digests of the SPKInfo for the mozilla trust store
function loadNSSCertinfo(derTestFile) {
  let allCerts = gCertDB.getCerts();
  let enumerator = allCerts.getEnumerator();
  let certNameToSKD = {};
  let certSKDToName = {};
  while (enumerator.hasMoreElements()) {
    let cert = enumerator.getNext().QueryInterface(Ci.nsIX509Cert);
    if (!isCertBuiltIn(cert)) {
      continue;
    }
    let name = cert.nickname.substr(BUILT_IN_NICK_PREFIX.length);
    let SKD = cert.sha256SubjectPublicKeyInfoDigest;
    certNameToSKD[name] = SKD;
    certSKDToName[SKD] = name;
  }
  {
    let der = readFileToString(derTestFile);
    let testCert = gCertDB.constructX509(der, der.length);
    let name = "End Entity Test Cert";
    let SKD  = testCert.sha256SubjectPublicKeyInfoDigest;
    certNameToSKD[name] = SKD;
    certSKDToName[SKD] = name;
  }
  return [certNameToSKD, certSKDToName];
}
function loadNSSCertinfo ( derTestFile ) { let allCerts = gCertDB . getCerts ( ) ; let enumerator = allCerts . getEnumerator ( ) ; let certNameToSKD = { } ; let certSKDToName = { } ; while ( enumerator . hasMoreElements ( ) ) { let cert = enumerator . getNext ( ) . QueryInterface ( Ci . nsIX509Cert ) ; if ( ! isCertBuiltIn ( cert ) ) { continue ; } let name = cert . nickname . substr ( BUILT_IN_NICK_PREFIX . length ) ; let SKD = cert . sha256SubjectPublicKeyInfoDigest ; certNameToSKD [ name ] = SKD ; certSKDToName [ SKD ] = name ; } { let der = readFileToString ( derTestFile ) ; let testCert = gCertDB . constructX509 ( der , der . length ) ; let name = "End Entity Test Cert" ; let SKD = testCert . sha256SubjectPublicKeyInfoDigest ; certNameToSKD [ name ] = SKD ; certSKDToName [ SKD ] = name ; } return [ certNameToSKD , certSKDToName ] ; }
nicknames and digests of the SPKInfo for the mozilla trust store
nicknames and digests of the SPKInfo for the mozilla trust store
// A certificate for *.example.com. // We can't include this cert in the previous loop, because it skips // non-builtin certs and the nickname is not built-in to the cert.