Java digital signature (digital signature) Batch File Creation

Source: Internet
Author: User

Java digital signature (digital signature) Batch File Creation


Prepare the following five batch files:

 

Set. cmd

Set jdk_bin = E:/"Program Files"/Java/jdk1.6.0 _ 24/bin
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

In order to enter the redirection file, read each line from the text file to answer the command line question, and press ENTER for submission.
-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]


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.