Yes, you can initialize NSS with NSS_NoDB_Init(NULL).
Then NSS won't create or use any databases.
You can then import certificates as "temporary certificates"
(as opposed to "permanent certificates" or "token certificates"
that are stored in cert8.db) and perform operations on them.
Wan-Teh
Hi,
Is there a way to do certificate operations in NSS without using the cert8.db? I was looking at a post at mail-archive.com (http://www.mail-archive.com/dev-tec...@lists.mozilla.org/msg00245.html) that suggested all this would now be internal to the PKCS #11 module, removing dependence on cert8.db. Does that mean I can use the certdb library to handle certificate operations?
Thanks,
Kai
--
dev-tech-crypto mailing list
https://lists.mozilla.org/listinfo/dev-tech-crypto
You should always pass the return value of CERT_GetDefaultCertDB()
as the CERTCertDBHandle * argument to those certificate functions.
Once you initialize NSS (with or without databases), CERT_GetDefaultCertDB()
will return a suitable value.
Wan-Teh
Wan-Teh
Yes. You get a handle to a "pseudo cert DB" (actually, a trust domain)
regardless of which way you initialize NSS.
As you know, NSS is now in its third major release (3.x) and this third
release uses PKCS#11 modules for all crypto and for all key and cert
storage. Older major versions of NSS did not use PKCS#11 for cert storage
but instead directly accessed the cert DB. The function
CERT_GetDefaultCertDB is a hold over from NSS 1.x and is preserved for
backward binary and API compatibility, but it no longer actually returns
a real DB handle. Now, it returns a handle of another type, and all the
functions that expect to receive that handle expect to receive a handle of
that type.
> Does this guarantee that any key material stays inside a third-party PKCS
> #11 module during certificate and cryptographic operations?
Yes.