Expand java.policy

I wrote some Java applets and linked them to a signed JAR. Although the applets are signed, they should still have some changes on the client regarding the java.policy file. For example, to complete a print job.

To help the end user, the user can load another JAR with a small Swing application that will add entries to their .java.policy .

My questions:

Is there a known library for deploying / delivering / installing java.policy ?

A small application will simply add to .java.policy . If you run it several times, the program will add the same data several times. It would be better if I only add the entry once. For this, I have to .java.policy and write back. Is there any java.policy record management java.policy ?

+7
java security java-8 applet
source share
2 answers

The Java Policy Tool allows you to manipulate an existing policy file (and even create new ones). But it is mainly intended for developers. If you want to make it more user-friendly, I think you will have to write it yourself (you must reuse the code from a standard policy tool).

+4
source share

I do not think that changing local policy files is the right solution. Typically, your applet should indicate the required level of permissions in the manifest file, for example: Permissions: all-permissions Codebase: * Trusted-Only: true For more details on the follwing page, see "Permissions attribute"

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

An applet must also be signed.

+1
source share

All Articles