文档

Java™ 教程-Java Tutorials 中文版
设置策略文件以授予所需的权限
Trail: Security Features in Java SE
Lesson: Signing Code and Granting It Permissions
Section: Steps for the Code Receiver

设置策略文件以授予所需的权限

Next, you will use the Policy Tool to create a policy file named exampleraypolicy and in it grant a permission to code from a signed JAR file.

The JAR file must have been signed using the private key corresponding to the public key imported into Ray's keystore (exampleraystore) in the previous step. The certificate containing the public key is aliased by susan in the keystore. We will grant such code permission to read any file in the C:\TestData\ directory.

The steps are:

  1. 启动政策工具
  2. 指定密钥库
  3. 添加带有 SignedBy 别名的策略条目
  4. 保存策略文件

Previous page: Import the Certificate as a Trusted Certificate
Next page: Start Policy Tool