Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java API to download certificate to client keystore

843811Apr 5 2002 — edited Sep 5 2002
Hi,

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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 3 2002
Added on Apr 5 2002
2 comments
226 views