File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes Get client certificate in java applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Get client certificate in java applet" Watch "Get client certificate in java applet" New topic

Get client certificate in java applet

Andrew Davis

Joined: Jul 06, 2005
Posts: 4
Howdy folks,
I'm trying to have my applet pass my personal client certificate (.p12) that I loaded via the Java Control Panel to the server.
I also supplied these Java Applet Runtime Settings via the Java Control Panel:<local path to .p12><password>

I'm trying to load the client cert in the applet by doing:

KeyStore ks = KeyStore.getInstance("JKS"); ks.load(new FileInputStream(System.getProperty(""), System.getProperty("").toCharArray());

I can't access those properties from within the applet. I'm pretty sure that I need to sign my applet to get those properties.
But is it possible to load the client cert without needing the call to:
If I loaded the client certificate in the Java Control Panel, do I still need to use the Runtime Settings to get the client cert?
Seems like there should be another way to get the client certificate, without having to access the local filesystem.
I'm using JRE 1.6.0_10.
It is sorta covered in the JavaRanch Style Guide.
subject: Get client certificate in java applet