Reputation: 24630
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?
Upvotes: 7
Views: 496
Reputation: 109
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, e.g.:
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.
Upvotes: 1
Reputation: 95518
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).
Upvotes: 5