Note that there are some explanatory texts on larger screens.

plurals
  1. POreplace nsICertificateDialogs from firefox extension
    primarykey
    data
    text
    <p>I'm trying to replace the <code>nsICertificateDialogs</code> dialog with my own implementation. I already have an extension that handles smime mails from webmail. I want to be able to use the Mozilla cert store with my extension. The only possibility I've found to export smime certs/keys (to use it in my extension) is via exporting a pfx file.</p> <p>I unregistered the original certifica tedialog and registered mine as described here <a href="https://stackoverflow.com/questions/10613562/failure-while-calling-nsix509certdb-nsix509certdb-from-command-line">Failure while calling nsIX509CertDB.nsIX509CertDB from command line</a> (unregister the old factory and register mine with the correct contractID). When I call <code>Cc[@mozilla.org/nsCertificateDialogs;1].getService(Ci.nsICertificateDialogs);</code> my class gets instantiated. When calling <code>certDB.importPKCS12File(null, certfile)</code> I get an <code>NS_ERROR_FAILURE</code> and my dialog class is not instantiated.</p> <p>What is the difference when FF instantiates the certificate dialog. How can I test it? What am I missing?</p> <p>edit: my certificate dialog class does not get instanciated by ff - even when called with a valid token certDB.importPKCS12File(token, certfile); In change calling var certdialogInterface = Cc[sMimeCertificateDialog.mozillaContractID] .getService(Ci.nsICertificateDialogs); correctly instanciates my class (followed by some QueryInterface calls)</p> <p>edit: I uploaded a (hopefully) simple reproducer to <a href="http://www.sodgeit.de/dialog_reproducer.zip" rel="nofollow noreferrer">http://www.sodgeit.de/dialog_reproducer.zip</a> Look at src/chrome/components/smime_certificate_dialog.js and at src/tests/smime_certificate_dialog_test.js</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload