How to digitally sign a jar package

Source: Internet
Author: User
Tags java web
To enable applets or Java Web start programs to access client local resources, you need to digitally sign the applet or JWS program jar package, and then when the client opens the applet or JWS program, it prompts you to allow the program to access local resources. If users want to use your program, of course, can only choose OK. This allows your program to access the client's local resources according to certain access rights.

Signature steps:
1. Make the program into a jar package.
This I will not say more, with Eclipse,netbeans and other development tools are very convenient to pack.

2. Generate the. store file with the Keytool command.
Create a Keytool.bat file under any folder, enter

Keytool-genkey-keystore Xxx.keystore-alias xxx-validity 3650

Save, double-click execution. A xxx.keystore file will be generated in the current directory,-alias followed by an alias, and-validity followed by a valid number of days for the certificate, where 3650 indicates 10. (The program signed with this certificate is valid for 10 years).

3. Sign the jar package with the Jarsigner program.
New Jarsinger.bat file, enter

Jarsigner-keystore xxx.keystore Helloworld.jar xxx

So the Helloworld.jar was signed.

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.