JAVA instance-learn to use java for Digital Signature

Source: Internet
Author: User
Tags microsoft frontpage
JAVA instance-learn how to use java for digital signature-general Linux technology-Linux programming and kernel information. The following is a detailed description. Digital Signature
If a java Applet written using an Applet has not been signed, the access to the client program will be subject to security restrictions after downloading it. how to add a java Applet signature has attracted the attention of many people, these documents are also available for reference on the Internet, but they are not complete. Here I will provide a document for specific operations, hoping to help you.

Scenario: test. jar: contains the java applet to be signed.

Result: After signing, the client can automatically download the java Applet, And the java Applet can access any resources of the client.

Steps:

(1) package java applets

Jar cvf test. jar test. class

(2) generate a keystore named chinani. store and Its alias is chinani.

Keytool-genkey-keystore chinani. store-alias chinani

Password: 123456 (enter the password as needed)

Enter the following as needed and confirm: y

(3) export the chinani. cer Digital Certificate

Keytool-export-keystore chinani. store-alias chinani-file chinani. cer

Password: 123456 (enter the password as needed)

(4) sign the test. jar File

Jarsigner-keystore chinani. store test. jar chinani

Password: 123456 (enter the password as needed)

Finally, write an html file and run it to automatically download and install the java applet.


<Html>
<Head>

<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 & gtNew Page 1 </title>

</Head>

<Body>

<! -- Automatically downloads the jre package -->

<OBJECT

Classid = "clsid: CAFEEFAC-0014-0000-0000-ABCDEFFEDCBA"

WIDTH = 300 HEIGHT = 300

Codebase = "jinstall-1_4_0-win.cab # Version =,">

<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>

</Html>
Related Article

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.