File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes Do I really need to sign a simple applet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Do I really need to sign a simple applet?" Watch "Do I really need to sign a simple applet?" New topic

Do I really need to sign a simple applet?

Nathan Popham

Joined: Sep 23, 2009
Posts: 9

I have an applet that reads from a text file (same directory), and I've run into the security error.

I've been looking into signing it through the links on this site, but I really do not understand it. One website seemed to say that the applet can access files in its own directory. (Mine can't.) Do you need to sign it even if it's only trying to access its own directory?

The other thing I ran into was requesting a certificate file from someone. Do you have to do that for an unofficially signed applet that requests permission from the user?

Sorry about the common question, I know there's a lot of information on the sites linked to from here. I just don't get it, and would appreciate a little push .
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Applets can access all files on the same server that they are served from, not just from their own directory; they don't need to be signed in order to do that. What unsigned applets can't do is use anything based on File objects - like the FileInputStream and FileReader classes.

See the HelloServerFile in the CodeBarn for an example of how to do this:
I agree. Here's the link:
subject: Do I really need to sign a simple applet?
It's not a secret anymore!