2001-02-13 12:32:01 +00:00
|
|
|
<html>
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Language" content="en-us">
|
2005-03-07 18:09:10 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css"/>
|
2002-02-03 22:00:42 +00:00
|
|
|
<title>SignJar Task</title>
|
2001-02-13 12:32:01 +00:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<h2><a name="signjar">SignJar</a></h2>
|
|
|
|
<h3>Description</h3>
|
2005-03-22 17:36:58 +00:00
|
|
|
<p>Signs JAR files with the <tt>jarsigner</tt> command line tool.
|
|
|
|
It will take a named file in the <tt>jar</tt> attribute, and an optional
|
|
|
|
<tt>destDir</tt> or <tt>signedJar</tt> attribute. Nested filesets are also
|
|
|
|
supported; here only an (optional) <tt>destDir</tt> is allowed. If a destination
|
|
|
|
directory or explicit JAR file name is not provided, JARs are signed in place.
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
Dependency rules
|
|
|
|
</p>
|
|
|
|
<ul>
|
|
|
|
<li>Nonexist destination JARs are created/signed</li>
|
|
|
|
<li>Out of date destination JARs are created/signed</li>
|
|
|
|
<li>If a destination file and a source file are the same,
|
|
|
|
and <tt>lazy</tt> is true, the JAR is only signed if it does not
|
2005-03-23 14:09:06 +00:00
|
|
|
contain a signature by this alias.</li>
|
2005-03-22 17:36:58 +00:00
|
|
|
<li>If a destination file and a source file are the same,
|
|
|
|
and <tt>lazy</tt> is false, the JAR is signed.</li>
|
|
|
|
</ul>
|
|
|
|
|
2001-02-13 12:32:01 +00:00
|
|
|
<h3>Parameters</h3>
|
|
|
|
<table border="1" cellpadding="2" cellspacing="0">
|
|
|
|
<tr>
|
|
|
|
<td valign="top"><b>Attribute</b></td>
|
|
|
|
<td valign="top"><b>Description</b></td>
|
|
|
|
<td align="center" valign="top"><b>Required</b></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">jar</td>
|
|
|
|
<td valign="top">the jar file to sign</td>
|
2003-04-10 06:37:57 +00:00
|
|
|
<td valign="top" align="center">Yes, unless nested filesets have
|
|
|
|
been used.</td>
|
2001-02-13 12:32:01 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">alias</td>
|
|
|
|
<td valign="top">the alias to sign under</td>
|
|
|
|
<td valign="top" align="center">Yes.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">storepass</td>
|
|
|
|
<td valign="top">password for keystore integrity.</td>
|
|
|
|
<td valign="top" align="center">Yes.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">keystore</td>
|
|
|
|
<td valign="top">keystore location</td>
|
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">storetype</td>
|
|
|
|
<td valign="top">keystore type</td>
|
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">keypass</td>
|
|
|
|
<td valign="top">password for private key (if different)</td>
|
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">sigfile</td>
|
|
|
|
<td valign="top">name of .SF/.DSA file</td>
|
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">signedjar</td>
|
2005-03-22 17:36:58 +00:00
|
|
|
<td valign="top">name of signed JAR file. This can only be set when
|
|
|
|
the <tt>jar</tt> attribute is set.</td>
|
|
|
|
<td valign="top" align="center">No.</td>
|
2001-02-13 12:32:01 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">verbose</td>
|
|
|
|
<td valign="top">(true | false) verbose output when signing</td>
|
2001-12-12 06:59:31 +00:00
|
|
|
<td valign="top" align="center">No; default false</td>
|
2001-02-13 12:32:01 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">internalsf</td>
|
|
|
|
<td valign="top">(true | false) include the .SF file inside the signature
|
|
|
|
block</td>
|
2001-12-12 06:59:31 +00:00
|
|
|
<td valign="top" align="center">No; default false</td>
|
2001-02-13 12:32:01 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">sectionsonly</td>
|
|
|
|
<td valign="top">(true | false) don't compute hash of entire manifest</td>
|
2001-12-12 06:59:31 +00:00
|
|
|
<td valign="top" align="center">No; default false</td>
|
2001-02-13 12:32:01 +00:00
|
|
|
</tr>
|
2001-12-12 06:59:31 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">lazy</td>
|
|
|
|
<td valign="top">flag to control whether the presence of a signature
|
2005-03-22 17:36:58 +00:00
|
|
|
file means a JAR is signed. This is only used when the target JAR matches
|
|
|
|
the source JAR</td>
|
2001-12-12 06:59:31 +00:00
|
|
|
<td valign="top" align="center">No; default false</td>
|
2002-12-23 13:29:16 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">maxmemory</td>
|
|
|
|
<td valign="top">Specifies the maximum memory the jarsigner VM will use. Specified in the
|
|
|
|
style of standard java memory specs (e.g. 128m = 128 MBytes)</td>
|
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
2004-11-26 09:52:06 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">preservelastmodified</td>
|
2005-03-22 17:36:58 +00:00
|
|
|
<td valign="top">Give the signed files the same last modified
|
|
|
|
time as the original jar files.</td>
|
2004-11-26 09:52:06 +00:00
|
|
|
<td valign="top" align="center">No; default false.</td>
|
|
|
|
</tr>
|
2005-03-23 15:06:48 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">tsaurl</td>
|
|
|
|
<td valign="top">URL for a timestamp authority for timestamped
|
|
|
|
JAR files in Java1.5+</td>
|
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">tsacert</td>
|
|
|
|
<td valign="top">alias in the keystore for a timestamp authority for
|
|
|
|
timestamped JAR files in Java1.5+</td>
|
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
|
|
|
|
2001-02-13 12:32:01 +00:00
|
|
|
</table>
|
2001-12-12 06:59:31 +00:00
|
|
|
<h3>Parameters as nested elements</h3>
|
|
|
|
<table border="1" cellpadding="2" cellspacing="0">
|
|
|
|
<tr>
|
|
|
|
<td valign="top"><b>Attribute</b></td>
|
|
|
|
<td valign="top"><b>Description</b></td>
|
|
|
|
<td align="center" valign="top"><b>Required</b></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">fileset</td>
|
2005-03-22 17:36:58 +00:00
|
|
|
<td valign="top">fileset of JAR files to sign. </td>
|
2001-12-12 06:59:31 +00:00
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
2005-03-22 17:36:58 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">mapper</td>
|
|
|
|
<td valign="top">A mapper to rename jar files during signing</td>
|
|
|
|
<td valign="top" align="center">No, and only one can be supplied</td>
|
|
|
|
</tr>
|
2005-03-24 15:01:30 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">sysproperty</td>
|
|
|
|
<td valign="top">JVM system properties, with the syntax of Ant
|
|
|
|
<a href="exec.html#env">environment variables</a> </td>
|
|
|
|
<td valign="top" align="center">No, and only one can be supplied</td>
|
|
|
|
</tr>
|
2005-03-22 17:36:58 +00:00
|
|
|
</table>
|
2005-03-24 15:01:30 +00:00
|
|
|
|
|
|
|
|
2001-02-13 12:32:01 +00:00
|
|
|
<h3>Examples</h3>
|
2005-03-09 17:26:03 +00:00
|
|
|
<blockquote><pre>
|
|
|
|
<signjar jar="${dist}/lib/ant.jar"
|
|
|
|
alias="apache-group" storepass="secret"/>
|
|
|
|
</pre></blockquote>
|
|
|
|
<p>
|
|
|
|
signs the ant.jar with alias "apache-group" accessing the
|
|
|
|
keystore and private key via "secret" password.
|
|
|
|
</p>
|
2005-03-24 15:01:30 +00:00
|
|
|
<blockquote><pre>
|
|
|
|
<signjar destDir="signed"
|
|
|
|
alias="testonly" keystore="testkeystore"
|
|
|
|
storepass="apacheant"
|
|
|
|
preservelastmodified="true">
|
|
|
|
<fileset dir="dist" includes="**/*.jar" />
|
|
|
|
<flattenmapper />
|
|
|
|
</signjar>
|
|
|
|
</pre></blockquote>
|
|
|
|
<p>
|
|
|
|
Sign all JAR files matching the dist/**/*.jar pattern, copying them to the
|
|
|
|
directory "signed" afterwards. The flatten mapper means that they will
|
|
|
|
all be copied to this directory, not to subdirectories.
|
2005-03-23 15:06:48 +00:00
|
|
|
|
2005-03-24 15:01:30 +00:00
|
|
|
</p>
|
|
|
|
<blockquote><pre>
|
|
|
|
<signjar
|
|
|
|
alias="testonly" keystore="testkeystore"
|
|
|
|
storepass="apacheant"
|
|
|
|
lazy="true"
|
|
|
|
>
|
|
|
|
<fileset dir="dist" includes="**/*.jar" />
|
|
|
|
</signjar>
|
|
|
|
</pre></blockquote>
|
|
|
|
<p>
|
|
|
|
Sign all the JAR files in dist/**/*.jar <i>in-situ</i>. Lazy signing is used,
|
|
|
|
so the files will only be signed if they are not already signed.
|
|
|
|
</p>
|
2005-03-23 15:06:48 +00:00
|
|
|
<h3>About timestamp signing</h3>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
Timestamped JAR files are a new feature in Java1.5; a feature supported in Ant since
|
|
|
|
Ant 1.7. Ant does not yet support proxy setup for this singing process, and
|
|
|
|
the whole TSA feature is not tested yet. Furthermore, the
|
|
|
|
<a href="http://java.sun.com/j2se/1.5.0/docs/guide/security/time-of-signing-beta1.html">
|
|
|
|
official TSA documentation</a>
|
|
|
|
warns that the API is subject to change. If a future version of Java changes the
|
|
|
|
API, Ant will break. It may be possible to hide changes if and when they occur,
|
|
|
|
but this can not be guaranteed.
|
|
|
|
</p>
|
|
|
|
|
2001-02-13 12:32:01 +00:00
|
|
|
<hr>
|
2005-02-09 07:54:12 +00:00
|
|
|
<p align="center">Copyright © 2000-2005 The Apache Software Foundation. All rights
|
2001-02-13 12:32:01 +00:00
|
|
|
Reserved.</p>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|