Java digital signature batch file creation

Source: Internet
Author: User

Prepare the following five batch files:

Set. cmd

Set JDK_BIN = E: "Program Files" Javajdk1.6.0 _ 24in
Set KEY_FOLDER = E: DigitalSignature

 


Key. cmd

Call set. cmd
% JDK_BIN % keytool-genkey-keystore % KEY_FOLDER % cuckoo. keystore-alias cuckoo <KEY_ANSWER.lst
% JDK_BIN % keytool-selfcert-keystore % KEY_FOLDER % cuckoo. keystore-alias cuckoo-validity 1000 <KEY_PWD.lst
% JDK_BIN % keytool-export-keystore % KEY_FOLDER % cuckoo. keystore-alias cuckoo-file % KEY_FOLDER % cuckoo. cer <KEY_PWD.lst
Note: KEY_ANSWER.lst and KEY_PWD.lst are the input redirection files. read each line from the text file to answer the command line question. Press the newline and press enter to submit. -Validity is followed by the signature validity period, in days. The default value is half a year.


Example: KEY_ANSWER.lst

Password
Password
Ren Jian
The CUCKOO Workgroup
Sun Yat-sen University
Guangzhou
Guangdong
CN
Yes
(Add two lines to the end)

 

KEY_PWD.lst

Password

(Line feed)

 


Selfsign. cmd


% JDK_BIN % jarsigner-keystore % KEY_FOLDER % cuckoo. keystore % 1 cuckoo <KEY_PWD.lst

 


Sign. cmd

Call set. cmd
Call selfsign. cmd % 1

 


Batchsign. cmd

Call set. cmd
For % N in (% 1 *. jar) do call selfsign. cmd % N

 


Instructions for use:


1. set the JDK_BIN folder location and the folder location where the Key is stored in set. cmd.

2. Run key. cmd to generate a key

3. Single file Signature
Command: sign. cmd [jar]

4. Batch sign all files in the specified folder:
Command: batchsign. cmd [jar_folder]


 

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.