Documentation

The Java™ Tutorials
Hide TOC
Signing Code and Granting It Permissions对代码进行签名并授予其权限
Trail: Security Features in Java SE

Lesson: Signing Code and Granting It Permissions课:签名代码并授予其权限

This lesson shows how to use keytool, jarsigner, Policy Tool and jar to place files into JAR (Java ARchive) files for subsequent signing by the jarsigner tool.本课将展示如何使用keytooljarsignerPolicy Tooljar将文件放入jar(Java ARchive)文件中,以便jarsigner工具进行后续签名。

This lesson has two parts. First, you will create and deploy an application. Second; you will act as the recipient of a signed application.本课分为两部分。首先,您将创建并部署一个应用程序。第二;您将作为已签名申请的收件人。

Here are the steps to create and deploy an application:以下是创建和部署应用程序的步骤:

Note:  For convenience, you pretend to be a user/developer named Susan Jones. You need to define Susan Jones when you generate the keys.为了方便起见,你假装是一个名叫苏珊·琼斯的用户/开发人员。生成密钥时需要定义Susan Jones。

Here are the steps to grant permissions to an application以下是向应用程序授予权限的步骤

Note:  For convenience, you pretend to be a user named Ray.为了方便起见,您可以假装是一个名为Ray的用户。

For more information about digital signatures, certificates, keystores, and the tools, see the API and Tools Use for Secure Code and File Exchanges lesson.有关数字签名、证书、密钥库和工具的更多信息,请参阅API和用于安全代码和文件交换的工具课程。


Important: You need to perform the tasks in this lesson while working in the directory in which you store the sample application, but you should store the data file needed by the application in a different directory. 在存储示例应用程序的目录中工作时,需要执行本课中的任务,但应将应用程序所需的数据文件存储在其他目录中。All examples in this trail assume that you are working in the C:\Test directory, and that the data file is in the C:\TestData directory.本文中的所有示例都假设您在C:\Test目录中工作,并且数据文件在C:\TestData目录中。

If you are working on a UNIX system, substitute your own directory names. 如果您在UNIX系统上工作,请替换您自己的目录名。

Here are the steps:以下是步骤:


Previous page: Previous Lesson
Next page: Steps for the Code Signer