my dog learned polymorphism*
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
Author

Simplifying Signed Applets?

Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 381
After a great deal of trouble, I finally got the example at http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed.html 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 Write.jp? Is this not redundant? How would we specify Write.jp 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}?

Thanks,
Siegfried
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41114
    
  45
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?


Ping & DNS - my free Android networking tools app
Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 381
I guess I need help understanding applet signing. In the sun tutorial at http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed.html, 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 amazon.com, for example, going thru that much trouble to use the amazon.com 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?

Thanks,
Siegfried
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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.
 
jQuery in Action, 2nd edition
 
subject: Simplifying Signed Applets?
 
Similar Threads
Java Plug-In and Firefox
Wanted: Help Creating policy file
IE and NN Compability
Applet to database problem
HTML and RMI