HELP ! Policy file to allow signed applets to access local printer/.

I have a signed applet which is accessing the default client printer. I am currently upgrading to use Java 1.4.2_08 plugin version...There is javascript which accesses the applet methods so even though it is signed I still need to use java policy file ...what permission should i setup so that the applet can print on client printer?

I tried all options I can and have no ideas left..It used to work perfectly with my java 1.3 plugin..

The only way this seems to work is to use the following which we dont want as the client machines are now open to all applets downloaded from any webserver.

grant {

permission java.security.AllPermission;

};

[681 byte] By [debo_naira] at [2007-10-2 6:39:09]
# 1

Since 1.4.2 the stack is checked correctly (according to specs).

This means allthough the current method of the signed applet is "trusted" the

method that called the current method is not (javascript).

Sollution could be doprivileged or set a parameter from javascript that is

checked by a seporate thread in the applet (see link below).

Signing applets:

http://forum.java.sun.com/thread.jsp?forum=63&thread=524815

second post and reply 18 for the java class file using doprivileged

http://forum.java.sun.com/thread.jsp?forum=63&thread=409341

4th post explaining how to set up your own policy with your own keystore

Still problems?

A Full trace might help us out:

http://forum.java.sun.com/thread.jspa?threadID=656028

harmmeijera at 2007-7-16 13:47:21 > top of Java-index,Security,Signed Applets...
# 2
Thanks harmmeijer . I actually read your old posts before you replied and that helped a lot...it solved my problem..Truly appreciate all the replies you offer here..
debo_naira at 2007-7-16 13:47:21 > top of Java-index,Security,Signed Applets...
# 3

I am facing same problem can you please help me?

i have policy file in my JRE is as...

Path of file: C:\Program Files\Java\jre1.5.0_04\lib\security

Contents:

// Standard extensions get all permissions by default

grant codeBase "file:${{java.ext.dirs}}/*" {

permission java.security.AllPermission;

};

// default permissions granted to all domains

grant {

// Allows any thread to stop itself using the java.lang.Thread.stop()

// method that takes no argument.

// Note that this permission is granted by default only to remain

// backwards compatible.

// It is strongly recommended that you either remove this permission

// from this policy file or further restrict it to code sources

// that you specify, because Thread.stop() is potentially unsafe.

// See "http://java.sun.com/notes" for more information.

permission java.lang.RuntimePermission "stopThread";

// allows anyone to listen on un-privileged ports

permission java.net.SocketPermission "localhost:1024-", "listen";

// "standard" properies that can be read by anyone

permission java.util.PropertyPermission "java.version", "read";

permission java.util.PropertyPermission "java.vendor", "read";

permission java.util.PropertyPermission "java.vendor.url", "read";

permission java.util.PropertyPermission "java.class.version", "read";

permission java.util.PropertyPermission "os.name", "read";

permission java.util.PropertyPermission "os.version", "read";

permission java.util.PropertyPermission "os.arch", "read";

permission java.util.PropertyPermission "file.separator", "read";

permission java.util.PropertyPermission "path.separator", "read";

permission java.util.PropertyPermission "line.separator", "read";

permission java.util.PropertyPermission "java.specification.version", "read";

permission java.util.PropertyPermission "java.specification.vendor", "read";

permission java.util.PropertyPermission "java.specification.name", "read";

permission java.util.PropertyPermission "java.vm.specification.version", "read";

permission java.util.PropertyPermission "java.vm.specification.vendor", "read";

permission java.util.PropertyPermission "java.vm.specification.name", "read";

permission java.util.PropertyPermission "java.vm.version", "read";

permission java.util.PropertyPermission "java.vm.vendor", "read";

permission java.util.PropertyPermission "java.vm.name", "read";

};

};

Store File: D:\tomcat5.5.4\webapps\pos_dev\applets\pos.store

How do i put permissions to allow my Applet to access Local printer ?

RashMin....a at 2007-7-16 13:47:21 > top of Java-index,Security,Signed Applets...