aspose file tools
The moose likes Applets and the fly likes Simplifying Signed Applets? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Simplifying Signed Applets?" Watch "Simplifying Signed Applets?" New topic

Simplifying Signed Applets?

Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 391
After a great deal of trouble, I finally got the example at to work in applet viewer.

(1) Do IE and Netscape/Firefox use %HOMEDRIVE%%HOMEPATH%/.java.policy on windows?
(2) If %HOMEDRIVE%%HOMEPATH%/.java.policy specifies the keystore, why does the above example use Is this not redundant? How would we specify for IE or Netscape/firefox?
(3) Must all my users use the policytool.exe (or, worse yet, notepad) to create or edit the .java.policy file? This seems like it would be a bit much to ask of the casual user. Is there a way to simplify this? ActiveX controls like the flash player don't require nearly so much of the user.
(4) What is the syntax for the .java.policy file? Does it use forward or backward slashs on windows? Does it expand environment variables like %HOMEDRIVE%%HOMEPATH% or do I use the java style ${user.home} or do I use the linux style ${HOME}?

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42956
Is there a particular reason you want users to fiddle around with their local policy files? As you said, that's tricky business. Have you considered signing the applet instead?
Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 391
I guess I need help understanding applet signing. In the sun tutorial at, they had me sign the jar file (in the role of the applet developer) and also fiddle with the policytool.exe (in the role of the user called Ray).

Is the tutorial wrong or did I misunderstand that tutorial? Ray is the guy running the browser or applet viewer and he has to run the policy tool. I cannot imagine the average user of, for example, going thru that much trouble to use the site.

Can someone point me to a signing tutorial that does not require the user to run policytool or create a policy and works with IE and Firefox and appletviewer?

Paul Clapham

Joined: Oct 14, 2005
Posts: 19553

No, the guy doing all of that stuff is the programmer who puts the applet up on the web. Once you've done all that ugly stuff, you just put the applet into your website. Programmers are expected to be able to deal with that sort of thing.

When a user downloads your applet and tries to run it, he will be shown a box which says that you have signed it and that your signing authority is whoever you said it was when you did the signing process. The user can then decide whether to trust your applet or not, and then clicks the "OK" or "Hell No" box depending on his choice.

Signed applets work just fine with all the main browsers.
Consider Paul's rocket mass heater.
subject: Simplifying Signed Applets?