On Fri, Sep 19, 2008 at 6:01 AM, brianhks <[EMAIL PROTECTED]> wrote: > I'm writing a utility as part of an automated install program that > will open the Firefox certificate database and install a local CA > certificate. This is what I've tried: > > dbHandle = (CERTCertDBHandle*)PORT_ZAlloc(sizeof(CERTCertDBHandle)); > rv = CERT_OpenCertDBFilename(dbHandle, (char*)dbPath.c_str(), > PR_FALSE); > > The dbPath is a relative path to the cert8.db file. > > The problem is that CERT_OpenCertDBFilename fails but PORT_GetError > returns nothing.
This is because CERT_OpenCertDBFilename is deprecated. It is now just a stub that does nothing. It should set the error code PR_NOT_IMPLEMENTED_ERROR though. I filed a bug report on this issue: https://bugzilla.mozilla.org/show_bug.cgi?id=456036 I believe that you should call NSS_InitReadWrite, which opens the cert database in read-write mode, and then call CERT_GetDefaultCertDB. > If this were to work I was going to call CERT_ImportCerts to put my > certificate in. Is this the right way to do it or is there a better > way? I think this is the right way to do it, but I'm not that familiar with this part of NSS... Wan-Teh _______________________________________________ dev-tech-crypto mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-crypto

