Current location - Quotes Website - Personality signature - How to sign a JAR package
How to sign a JAR package
< ! -- [if gte mso 9]> < ! [endif]--> < ! -- [if gte mso 9]> < ! [endif]--> < ! -- [if gte mso 1]> Objective: In order to make the Applet or Java Web Start program access the local resources of the client, it is necessary to digitally sign the jar package of the Applet or JWS program, and then when the client opens the Applet or JWS program, it will prompt whether the program is allowed to access the local resources. If the user wants to use your program, of course, he can only choose OK. In this way, your program can access the local resources of the client according to some access rights. Signature steps: 1. Type the program into a jar package. I won't say much about this. It can be packaged easily with development tools such as eclipse and netbeans. 2. Use the keytool command to generate the. store file. Create a keytool.bat file in any folder, enter

keytool-genkey-keystorexxx.keystore-alias XXX-validity 365

to save, and double-click to execute. A xxx.keystore file will be generated in the current directory. -alias is followed by alias, and -validity is followed by the validity days of the certificate, where 365 means 1 years. The program signed with this certificate is valid for 1 years. 3. Sign the jar package with jarsigner program. Create a new jarsinger.bat file, and enter jarsigner-keystorexxx.keystorehelloworld.jarxxx.