Jana,

pk12util is part of the utilities that ship with a NSS release.  You
can find the NSS Release Directory here:
ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/
You have a choice between downloading source code or pre-compiled
binaries.

If you download the source code, you can find build instructions here:
http://developer.mozilla.org/en/docs/NSS_reference:Building_and_installing_NSS

After you get pk12util, you need to use it with your Mozilla
certificate database.  I don't know where that would be in Windows,
but in Linux it is usually in $(HOME)/.mozilla/firefox/<profile-name>

where I believe <profile-name> is randomly chosen.

Documentation on how to use pk12util is available here:
http://www.mozilla.org/projects/security/pki/nss/tools/pk12util.html


Now, there might be a better way for you to do this from within your
Java program. NSS provides API to export PKCS#12 files, I believe.
For reference, you can refer to:

the list of public functions in the PKCS#12 API:
http://www.mozilla.org/projects/security/pki/nss/ref/nssfunctions.html#pkcs12

pk12util's source code:
http://lxr.mozilla.org/mozilla/source/security/nss/cmd/pk12util/

There is a project, called NSS for Java (JSS), which presents a Java
API of NSS functionality.  I am personally not familiar with it, so
maybe other people can help here more.
You can find the JSS project page at:
http://www.mozilla.org/projects/security/pki/jss/

You can look into that and see if you can access the Mozilla cert
database from your own Java code and export a PKCS#12 file if you
still need to do so.

I hope this helps.

Regards,
Peter

_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to