Search code examples
javascriptfirefoxcertificatexpcom

Writing firefox extension: How to export private key from certificate database? Possible?


I am writing a Firefox extension and am looking for a way to export the private key from an installed certificate.

This would be replacing the previous process of saving a backup PKCS12 .p12 file, then running using: "openssl pkcs12 -nocert -in backup.p12 -out userkey.pem"

Thanks!

EDIT: I can now save a PKCS12 backup using the XPCOM API, I can extract the Certificate, but am still looking for a way to extract the private key (see the openssl command above). This needs to be cross platform...


Solution

  • I have given up doing this. Instead I'm writing a python CGI script and sending the certificate and keys over an SSL connection to an Apache server.