javasecurityappletpolicyfiles

How can I add policy file to the jar applet which is embedded in html file


I have this HTML:

<html>
<title>The Hello, World Applet</title>
<hr>
<applet code=javaapplication4.test.class 
        archive="JavaApplication4.jar"
        width=600 height=400>
</applet>
<hr>
</html>

And I want to add the following policy file to it:

/* AUTOMATICALLY GENERATED ON Thu May 09 15:48:03 AST 2013*/
/* DO NOT EDIT */

grant {
  permission java.security.AllPermission;
};

Because I want to let my applet do AllPermission like the desktop application.

How can I do that ?


Solution

  • If your HTML could insert a policy file like that to my machine, it would be an huge security bug. Fortunately, to the best of my knowledge, it is not possible.

    If an applet needs trust, digitally sign it.