-->
-->
Digital signatures
Java applet written in applets if not signed, then access to the client program will be security restrictions; How to sign a Java applet is a lot of people's attention, online also have these aspects for reference documents, But all is not complete, here I give a can the concrete operation document, hoped can give everybody some help.
Scene:test.jar: java applet with pending signature
Result: After signing, the client can download the Java applet automatically , and the Java applet can access any resources of the client.
Steps:
(1) packaging a java applet
Jar CVF Test.jar Test.class
(2) Generates a KeyStore named Chinani.store with an alias of chinani
Keytool-genkey-keystore Chinani.store-alias Chinani
Password:123456 ( input According to your needs )
The following needs to be entered, and finally confirmed:y
(3) Export chinani.cer digital certificate
Keytool-export-keystore Chinani.store-alias Chinani-file Chinani.cer
Password:123456 ( input according to your needs )
(4) sign the Test.jar file
Jarsigner-keystore chinani.store test.jar chinani
Password:123456 ( input According to your needs )
Finally write an HTML file, run this file can automatically download installation run java applet
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<meta name= "generator" content= "Microsoft FrontPage 4.0" >
<meta name= "ProgId" content= "FrontPage.Editor.Document" >
<title>new Page 1</title>
<body>
<!-- can automatically download JRE package -->
<object
Classid= "CLSID:CAFEEFAC-0014-0000-0000-ABCDEFFEDCBA"
WIDTH = HEIGHT =
codebase= "jinstall-1_4_0-win.cab#version=1,4,0,0" >
<param NAME = CODE VALUE = "Test.class" >
<param NAME = ARCHIVE VALUE = "Test.jar" >
<param name= "type" value= "application/x-java-applet;jpi-version=1.4" >
<param NAME = "scriptable" VALUE = "false" >
</object>
</body>
-->
-->