Skip to Main Content

Java SE (Java Platform, Standard Edition)

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!

Get client certificate in applet after loading in Java Control Panel

843807Jan 29 2009
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:


-Djavax.net.ssl.keyStore="path to .p12 client cert in local filesystem"

-Djavax.net.ssl.keyStorePassword="password"

-Djavax.net.ssl.keyStoreType=PKCS12

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

KeyStore ks = KeyStore.getInstance("PKCS12");
ks.load(new FileInputStream(System.getProperty("javax.net.ssl.keyStore"),
System.getProperty("javax.net.ssl.keyStorePassword").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:
System.getProperty("javax.net.ssl.keyStorePassword")
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.

Thanks in advance!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 26 2009
Added on Jan 29 2009
0 comments
288 views