Digital signature (Java)

Source: Internet
Author: User
Tags microsoft frontpage
-->
-->

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>

-->
-->
<

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.