Test the archive you just created.
5.
% signtool -v testjar.jar
using certificate directory: /u/jsmith/.netscape
archive "testjar.jar" has passed crypto verification.
status
------------
verified
You can also use Netscape Signing Tool from within a script to automate some
aspects of signing. For example, here's a Windows script that starts with an
unsigned JAR file, unpackages it, signs it, and then repackages it:
rem Expand the jar file into a new directory
unzip -qq myjar.jar -d signjar
del myjar.jar
rem Sign everything in the new directory and recompress
signtool -k MySignCert -Z myjar.jar signdir
Using Netscape Signing Tool with a ZIP Utility
To use Netscape Signing Tool with a ZIP utility, you must have the utility in your
path environment variable. You should use the
e, which cannot handle long filenames.
pkzip.ex
You can use a ZIP utility instead of the
JAR file after you have signed it:
% cd signdir
% zip -r ../myjar.jar *
adding: META-INF/ (stored 0%)
adding: META-INF/manifest.mf (deflated 15%)
adding: META-INF/signtool.sf (deflated 28%)
adding: META-INF/signtool.rsa (stored 0%)
adding: text.txt (stored 0%)
%
Tips and Techniques
•
If you are storing JAR files or their components in CVS, store them as binary
files.
path
-------------------
test.f
zip.exe
option to package a signed archive into a
-Z
Using Netscape Signing Tool
utility rather than
Chapter 13
Netscape Signing Tool
93