CA:AddRootToFirefox: Difference between revisions

→‎AutoConfig via JavaScript: update code snippet and comment about nickname parameter
(Fix code sample)
(→‎AutoConfig via JavaScript: update code snippet and comment about nickname parameter)
Line 35: Line 35:
var Ci = Components.interfaces;
var Ci = Components.interfaces;
var certdb = Cc["@mozilla.org/security/x509certdb;1"].getService(Ci.nsIX509CertDB);
var certdb = Cc["@mozilla.org/security/x509certdb;1"].getService(Ci.nsIX509CertDB);
var certdb2 = certdb;
try {
  certdb2 = Cc["@mozilla.org/security/x509certdb;1"].getService(Ci.nsIX509CertDB2);
} catch (e) {}


cert = "MIIHPT...zTMVD"; // This should be the certificate content with no line breaks at all.
cert = "MIIHPT...zTMVD"; // This should be the certificate content with no line breaks at all.
certdb2.addCertFromBase64(cert, "C,C,C", "");
certdb.addCertFromBase64(cert, "C,C,C", "");
</pre>
</pre>


The three Cs mean to trust the certficate for servers, email and objects. The third parameter is the name, but it is ignored. If you want to install binary certificates, things get more complicated. In that case, I'd definitely recommend the [http://mike.kaply.com/cck2/ CCK2].
The three Cs mean to trust the certficate for servers, email and objects. The third parameter is the name, but it is ignored (as of Firefox 53, the third parameter has been removed from the API and should not be included). If you want to install binary certificates, things get more complicated. In that case, I'd definitely recommend the [http://mike.kaply.com/cck2/ CCK2].


== PolicyPak ==
== PolicyPak ==
Confirmed users
299

edits