A browser with JavaScript enabled is required for this page to operate properly.
Trail: Security Features in Java SE
Lesson: Signing Code and Granting It Permissions
The Java Tutorials have been written for JDK 8. Examples and practices described in this page don't take advantage of improvements introduced in later releases and might use technology no longer available.
See Dev.java for updated tutorials taking advantage of the latest releases.
See Java Language Changes for a summary of updated language features in Java SE 9 and subsequent releases.
See JDK Release Notes for information about new features, enhancements, and removed or deprecated options for all JDK releases.
Steps for the Code Signer
The code signer takes the following steps:
- Download and Try the Sample Application.
- Create a JAR File Containing the Class File, using the
jar
tool.
- Generate Keys (if they don't already exist), using the
keytool
-genkey
command.
Optional Step Generate a certificate signing request (CSR) for the public key certificate, and import the response from the certification authority (CA). For simplicity (and since you are only pretending to be Susan Jones), this step is omitted. See
Generating a Certificate Signing Request (CSR) for a Public Key Certificate for more information.
- Sign the JAR File, using the
jarsigner
tool and the private key.
- Export the Public Key Certificate, using the
keytool
-export
command. Then supply the signed JAR file and the certificate to the receiver Ray.