How do I generate a signed applet to enable the applet to access local resources?

Source: Internet
Author: User
In jdk1.1, you can use the Javakey command to generate the public key, private key, certificate, and signature jar files, please refer to the details: Http://java.sun.com/security/usingJavakey.html and Java 2 The signature mechanism has been improved to allow users more flexibility to set security permissions. Java 2 provides three tools: Keytool,policytool and Jarsigner to implement a signed applet. For example, Joe writes a signature Applet:SignedApplet.java, so the process of producing a simple signed applet is as follows:

Generates the key, the key alias is Joe, the password is sign12,
stored in the KeyStore joestore 
keytool-genkey-alias joe-keypass 
sign12-keystore 
//Will signedapplet. Class and related files are packaged into jar file 
jar CVF Signedappletdemo. Jar 
///Generate Signed applet (JAR file) 
Jarsigner-keystore Joestore-signedjar Joe.jar with Keytool generated self-signed certificate 
Signedappletdemo.jar Joe 
//Export self-signed certificate from KeyStore to file 
keytool-export-keystore joestore 
-alias joe-file Joe.cer


For the recipient of the signed applet, Susan, you need to perform the following steps safely

Signed applet written by Joe:

Get Joe's certificate and read it into the KeyStore susanstore 
keytool-import-alias joe-file
joe.cer-keystore susanstore 
// Run Policytool generate policy files that meet Susan's requirements 
Policytool 
//Run with Appletviewer, or install Java plugin in a browser.


For the deployment of a signed applet in the Java plugin, refer to the following Web page:

Http://java. Sun com/security/signexample12/

Note: For simplicity, the above example uses the self-signed certificate produced by Keytool. In fact, users can also use Keytool-certreq to apply for an electronic certificate to the commercial CA center.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.