File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes Plug-in/signed applet issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Plug-in/signed applet issue" Watch "Plug-in/signed applet issue" New topic

Plug-in/signed applet issue

Alex Belt
Ranch Hand

Joined: Jul 12, 2001
Posts: 57
I have a signed applet that users access in IE. Most use the Microsoft JVM, and the applet works since it's in a signed cab file. With MS support of Java at an end, users are starting to access this site with a Sun plug-in rather than the MS VM. I created a jar file with the same classes, and followed Thawte's instructions for using an Authenticode certificate to sign jar files. I have the certificate in an external pkcs12 keystore, and I signed the jar files using the jarsigner tool. I can verify the signature, but when I deploy the jar file and switch to the Java plug-in, it acts as if it wasn't signed and is still confined by the sandbox. It prompts the user if they want to accept the certificate, which is valid, but it doesn't grant them any permissions, so it throws a SecurityException because the applet tries to access the file system. I'm wondering if I overlooked something or if I signed the applet incorrectly. I realize this isn't a lot of detail, but I've checked the Sun tutorials, forums, and anywhere else I could think of, but I can't seem to find any ideas about what is wrong. If you need more info or have any ideas, please let me know.
Alex Belt
Ranch Hand

Joined: Jul 12, 2001
Posts: 57
Think I found the problem. Seems that in 1.4.x, when you call a method from javascript that executes privileged code, you have to go through the AccessControl.doPrivileged() method or it loses its privileges, even if the code is signed. What a mess. Now I'm going to have two sets of code floating around, one that works with the MS JVM, and another for the Sun plug-in.
Rawat Vijay

Joined: Jan 27, 2003
Posts: 17
Can you let me that piece of code I am also facing the same problem
It is sorta covered in the JavaRanch Style Guide.
subject: Plug-in/signed applet issue
Similar Threads
Signing Applet in NS 6
singed applets (are policy files needed)
Applet signing problem
Applet reading/writing to text files
JAXM Applet Problem