Java API to download certificate to client keystore
843811Apr 5 2002 — edited Sep 5 2002Hi,
I'm trying to write a program in Java to automate the task of downloading the digital certificate from a server and storing it in the client keystore. In my case, the server certificate is not signed by a CA.
Theoretically, I should be able to make a https connection to the server and when the server sends its certificate, I should be able to get a handle to it and store it in the keystore. However I'm not sure which is the correct set of APIs to use.
Using some hacks, I was able to get the certificate as an X509Certificate object. Is there any way to automate, using Java API, the task of storing the certificate into client keystore (without using the "keytool" utility)?
If someone could give a code fragment with an end-to-end solution, I'll appreciate it.
Thanks,
Pranav