my problem still did not get resolved. pls help me.
@arshad : thnk u. according to my understanding u r trying to retrieve the certificate from java key store and not from the browser's key store. My problem is like, " i have to fetch the certificate from the browser's key store and import it into the java key store."
can anybody help me..
thnx..
Girish,
The code that I pointed has source in it that describes accessing certificates and private-keys from either the NSS or the JKS key-store (as well as smartcards, etc.). All you need to do is open both the NSS keystore and the JKS keystore using two different variable names, and then read from NSS and write to JKS.
arshad
i am trying this on jdk1.6 with firefox 1.5 on windows. its giving me error.
if u had done it with java 6 , would u please give me the code and configuaration file. also let me know which jar to be used as nss-jce provider. can we do this using any provider from sun. i had done it in IE using summscapi. but i am facing problem in firefox.
its urgent
thanks
I don't recall if I had this working or not, but here is a configuration file I have in my source-base:
#JDK6
name = NSS
nssLibraryDirectory = /usr/local/firefox
nssDbMode = readOnly
nssSecmodDirectory = /usr/local/etc/symkey/pkcs11
The three *.db files from FF need to be in the nssSecmodDirectory location.
Firefox stores its certificate in a file called cert8.db. On the Linux/UNIX environment, this file is in a subdirectory of your $HOME directory called .mozilla/. On Windows, it is typically in the c:\Documents and Settings\<User>\Application Data\Mozilla\Firefox\Profiles\<Random Hash Value>\ directory.
Before you load the keystore, I am assuming you have configured the SunPKCS11 JCE Provider in your java.security file, and have gotten an instance of the provider using the KeyStore.getInstance("PKCS11") call. You should only have one PKCS11 providrer in java.security for this to work.
While the configuration file for JDK6 has changed a little bit, the concept and capability has not. If you're having trouble with JDK6, I would recommend trying it out on JDK5 first and making sure it works on your machine, and then trying it with JDK6. The source code in the keystoreLoaderHelper.java file in the SKCL module of the StrongKey source distribution (www.strongkey.org) has all the code in it that shows how to load keys/certificates using the Firefox and the JKS keystores.