> I have the code for reading the available key from the File using the
> KeyStore. But, i have tried my best to store the generated key into the File
> and i m not able to. Can some one help in these.
Actually the only thing you'd need to do is taking a closer look at the
examples in the JDK documentation. The specification for the KeyStore class
also list an example how to load/store keys, check
http://java.sun.com/j2se/1.5.0/docs/api/java/security/KeyStore.html.
Another read which has helped me a lot is
http://java.sun.com/j2se/1.5.0/docs/guide/security/CryptoSpec.html.
But summing up; the only thing you need is to add the key to the keystore using
the "KeyStore.setEntry" method. Once you've done that you can save it using an
FileOutputStream. From the top of my mind:
FileOutputStream fos = new FileOutputStream("name_of_keystore");
KeyStore.store(fos, "keystorepassword");
fos.close();
Now, do check this carefully. I'm not 100% positive that I got it all right,
but am pretty sure on the overall commands.
--
Groetjes, Peter
..\\ PGP/GPG key: http://www.catslair.org/pubkey.asc