简体   繁体   中英

Deploy java.policy

I have written some Java Applets and bundled them into a signed JAR. Even though the Applets are signed, they still need to be some changes on the client concerning the java.policy file. For example, to do a print job.

To help the end user, the user can download another JAR with a small Swing app which will add the entries to their .java.policy .

My questions:

Is there a well known library to deploy/deliver/install java.policy ?

The small application will simply append to the .java.policy . If run several time, the program will append the same data several times. It would be better if I only add the entry once. For that I have to parse the .java.policy and write back. Is there any library to manipulate java.policy entries?

Java's Policy Tool lets you manipulate existing policy file (and even create new ones). But it's mostly geared towards developers. If you want to make it more user-friendly, I imagine you would have to write one yourself (you should be able to reuse a lot of the code from the standard policy tool).

I don't think changing local policy files is the correct solution. Normally your applet should name the required permission level in its manifest file, eg: Permissions: all-permissions Codebase: * Trusted-Only: true More on the follwing page, see "Permissions Attribute"

https://docs.oracle.com/javase/8/docs/technotes/guides/deploy/manifest.html#A1148525

The applet needs to be signed as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM