Java Applet Signature Verification

Source: Internet
Author: User

From: http://100air.iteye.com/blog/52946

Java small written in AppletProgramIf no signature is obtained, access to the client program will be subject to security restrictions after downloading. The Sandbox mechanism restricts the applet security when running the applet stored on a remote host in a browser or appletviewer, java VM regards it as untrusted and puts it under the protection of the so-called sandbox. In this case, the applet operation is subject to the following restrictions:
:

A) the applet cannot read or write files on the client host.
B) the applet cannot perform the addprovider operation in JCE/JCA.
C) during network connection, the applet can only establish a connection with the server that provides it.
D) the applet is restricted in terms of event capture and system information reading.
E) In the Netscape browser, java. Security. * is not supported. In the IE browser, the running of the applet is more restrictive than appletviewer.

Many people are concerned about how to sign Java applets. There are also documents available for reference on the Internet, but they are not complete. Here I will provide a document for specific operations, hope to help you. Scenario: test. jar: contains the result of the Java applet to be signed: After the signature, 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 as needed) enter the following as needed, and finally 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 this file to automatically download and install the HTML file for running the Java Applet as follows:

<APPLET code = test
Archive = "test. Jar"
Width = 320 Height = 300>
</APPLET>

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.