need help with signing a java applet

flashbacck

Golden Member
Aug 3, 2001
1,921
0
76
I'm trying to have an applet write a file on the client system, but I'm having issues signing my applet. I think I'm missing something and would appreciate any help. Here are the steps I am taking...

1) keytool -genkey -alias blah
2) answer all the questiosn
3) jar -cvf Applet.jar *
4) jarsigner Applet.jar blah
5) applet code in the html file is:
<applet code=Applet.class archive=Applet.jar width="900" height="600">

6) run applet: appletviewer Applet.html

I then get an AccessControlException. What am I missing? Also, why do I still get the AccessControlException when I run my applet through appletviewer? I was under the impression appletviewer automagically gave permissions, and the AccessControlExceptions were only when you tried to run the applet off a server.

Some test code I'm using (AccessControlException at the System.getProperty line):


 

flashbacck

Golden Member
Aug 3, 2001
1,921
0
76
it works now in IE7, after I rebuilt the jar and resigned. But it still doesn't work in appletviewer...
 

MrChad

Lifer
Aug 22, 2001
13,507
3
81
Did you import the certificate you generated to sign the JAR into your certificate store (I believe it's another keytool command)?
 

flashbacck

Golden Member
Aug 3, 2001
1,921
0
76
Originally posted by: MrChad
Did you import the certificate you generated to sign the JAR into your certificate store (I believe it's another keytool command)?

er.. no I didn't... But if I generated it, isn't it already in the store?

Additionally, the certificate I generated will apparently only last 6 months. Is there a way to extend it indefinitely?
 

MrChad

Lifer
Aug 22, 2001
13,507
3
81
Originally posted by: flashbacck
Originally posted by: MrChad
Did you import the certificate you generated to sign the JAR into your certificate store (I believe it's another keytool command)?

er.. no I didn't... But if I generated it, isn't it already in the store?

Additionally, the certificate I generated will apparently only last 6 months. Is there a way to extend it indefinitely?

I'm fairly certain that you still need to import the certificate after generating it. But it's been a while since I had to sign an applet.

You're going to want to purchase a certificate from Certificate Authority such as Verisign or Thawte if you'll be deploying this somewhere.