Java Dynamic Management Kit 3.2 Programming Guide | ||||
---|---|---|---|---|
![]() | ![]() | Chapter 14. M-Let, Bootstrap and Launcher Services | ![]() | ![]() |
The m-let and bootstrap services support signed .jar files. In the code signing environment, this involves:
Creating a signer using the keytool security tool
Generating public and private keys for the signer using keytool
Exporting the certificate using keytool
Signing the .jar files using jarsigner
On the agent side, code signing involves the following:
Importing the signer's certificate into the keystore using keytool
Defining the security policies using policytool
Running the application with the security manager provided with JavaŽ 2 SDK
Example 14-14 shows a policy file entry for a jar file named example.jar coming from an HTTP server with codebase http://java.sun.com/ and signed by tester. This entry grants two permissions, the first one grants read access to all files in the directory /tmp and the second one grants access to the objects registered in the framework.
Example 14-14. Example Policy File Entry
grant codeBase "http://java.sun.com/example.jar", signedBy "tester" { permission java.io.FilePermission "/tmp/*", "read"; permission com.sun.jaw.reference.agent.cmf.FrameworkPermission "accessObjects"; }; |
![]() | ![]() | ![]() |
Security Manager | ![]() | Launcher Service |