Write Permissions for signed applet

Hi,

i'm using a signed applet to get a file access for my applet to the lacal disk. I want to write a file to a local directory. When i'm trying it in the appletviewer it works, but it is not running in the browser. I'm using the version 1.5.0_11 of the JRE.

I got the follwing exception:

java.security.AccessControlException: access denied (java.io.FilePermission C:\Teleimage\writeFile.txt write)

at java.security.AccessControlContext.checkPermission(Unknown Source)

at java.security.AccessController.checkPermission(Unknown Source)

at java.lang.SecurityManager.checkPermission(Unknown Source)

at java.lang.SecurityManager.checkWrite(Unknown Source)

at java.io.FileOutputStream.<init>(Unknown Source)

at java.io.FileOutputStream.<init>(Unknown Source)

at writeFile.init(writeFile.java:32)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

My policy entries:

keystore "file:/c:/Teleimage/CA/.keystore";

grant SignedBy "teleimage code signing certificate"{

permission java.io.FilePermission "c:/Teleimage/-","read,write";

};

I'm using the correct alias and the right keystore, but i always receive the exception above.

Can you help me solving that problem?

[1344 byte] By [ktommyka] at [2007-11-27 4:17:42]
# 1
Hi try this> keystore "file:/C:/Teleimage/CA/.keystore";HTH:)
monk3ya at 2007-7-12 9:24:22 > top of Java-index,Security,Signed Applets...
# 2
I had the similiar problem and finnaly Ive solved it today.In my case I have to add principal to policy entry, otherwise it doesnt work.
ahoja at 2007-7-12 9:24:22 > top of Java-index,Security,Signed Applets...
# 3
Hi You can also do a System.setSecurityManager(null);at the beginning of your init() methodThen you need not worry about setting persmissions in the java.policy fileHTH:)
monk3ya at 2007-7-12 9:24:22 > top of Java-index,Security,Signed Applets...