You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

signjar.html 5.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <link rel="stylesheet" type="text/css" href="../stylesheets/style.css"/>
  5. <title>SignJar Task</title>
  6. </head>
  7. <body>
  8. <h2><a name="signjar">SignJar</a></h2>
  9. <h3>Description</h3>
  10. <p>Signs JAR files with the <tt>jarsigner</tt> command line tool.
  11. It will take a named file in the <tt>jar</tt> attribute, and an optional
  12. <tt>destDir</tt> or <tt>signedJar</tt> attribute. Nested filesets are also
  13. supported; here only an (optional) <tt>destDir</tt> is allowed. If a destination
  14. directory or explicit JAR file name is not provided, JARs are signed in place.
  15. </p>
  16. <p>
  17. Dependency rules
  18. </p>
  19. <ul>
  20. <li>Nonexist destination JARs are created/signed</li>
  21. <li>Out of date destination JARs are created/signed</li>
  22. <li>If a destination file and a source file are the same,
  23. and <tt>lazy</tt> is true, the JAR is only signed if it does not
  24. contain any signature.</li>
  25. <li>If a destination file and a source file are the same,
  26. and <tt>lazy</tt> is false, the JAR is signed.</li>
  27. </ul>
  28. <p>
  29. When checking signatures, the actual signatory itself is not verified. This
  30. means that "lazy" checks do not work if a JAR is signed by multiple authors.
  31. </p>
  32. <h3>Parameters</h3>
  33. <table border="1" cellpadding="2" cellspacing="0">
  34. <tr>
  35. <td valign="top"><b>Attribute</b></td>
  36. <td valign="top"><b>Description</b></td>
  37. <td align="center" valign="top"><b>Required</b></td>
  38. </tr>
  39. <tr>
  40. <td valign="top">jar</td>
  41. <td valign="top">the jar file to sign</td>
  42. <td valign="top" align="center">Yes, unless nested filesets have
  43. been used.</td>
  44. </tr>
  45. <tr>
  46. <td valign="top">alias</td>
  47. <td valign="top">the alias to sign under</td>
  48. <td valign="top" align="center">Yes.</td>
  49. </tr>
  50. <tr>
  51. <td valign="top">storepass</td>
  52. <td valign="top">password for keystore integrity.</td>
  53. <td valign="top" align="center">Yes.</td>
  54. </tr>
  55. <tr>
  56. <td valign="top">keystore</td>
  57. <td valign="top">keystore location</td>
  58. <td valign="top" align="center">No</td>
  59. </tr>
  60. <tr>
  61. <td valign="top">storetype</td>
  62. <td valign="top">keystore type</td>
  63. <td valign="top" align="center">No</td>
  64. </tr>
  65. <tr>
  66. <td valign="top">keypass</td>
  67. <td valign="top">password for private key (if different)</td>
  68. <td valign="top" align="center">No</td>
  69. </tr>
  70. <tr>
  71. <td valign="top">sigfile</td>
  72. <td valign="top">name of .SF/.DSA file</td>
  73. <td valign="top" align="center">No</td>
  74. </tr>
  75. <tr>
  76. <td valign="top">signedjar</td>
  77. <td valign="top">name of signed JAR file. This can only be set when
  78. the <tt>jar</tt> attribute is set.</td>
  79. <td valign="top" align="center">No.</td>
  80. </tr>
  81. <tr>
  82. <td valign="top">verbose</td>
  83. <td valign="top">(true | false) verbose output when signing</td>
  84. <td valign="top" align="center">No; default false</td>
  85. </tr>
  86. <tr>
  87. <td valign="top">internalsf</td>
  88. <td valign="top">(true | false) include the .SF file inside the signature
  89. block</td>
  90. <td valign="top" align="center">No; default false</td>
  91. </tr>
  92. <tr>
  93. <td valign="top">sectionsonly</td>
  94. <td valign="top">(true | false) don't compute hash of entire manifest</td>
  95. <td valign="top" align="center">No; default false</td>
  96. </tr>
  97. <tr>
  98. <td valign="top">lazy</td>
  99. <td valign="top">flag to control whether the presence of a signature
  100. file means a JAR is signed. This is only used when the target JAR matches
  101. the source JAR</td>
  102. <td valign="top" align="center">No; default false</td>
  103. </tr>
  104. <tr>
  105. <td valign="top">maxmemory</td>
  106. <td valign="top">Specifies the maximum memory the jarsigner VM will use. Specified in the
  107. style of standard java memory specs (e.g. 128m = 128 MBytes)</td>
  108. <td valign="top" align="center">No</td>
  109. </tr>
  110. <tr>
  111. <td valign="top">preservelastmodified</td>
  112. <td valign="top">Give the signed files the same last modified
  113. time as the original jar files.</td>
  114. <td valign="top" align="center">No; default false.</td>
  115. </tr>
  116. </table>
  117. <h3>Parameters as nested elements</h3>
  118. <table border="1" cellpadding="2" cellspacing="0">
  119. <tr>
  120. <td valign="top"><b>Attribute</b></td>
  121. <td valign="top"><b>Description</b></td>
  122. <td align="center" valign="top"><b>Required</b></td>
  123. </tr>
  124. <tr>
  125. <td valign="top">fileset</td>
  126. <td valign="top">fileset of JAR files to sign. </td>
  127. <td valign="top" align="center">No</td>
  128. </tr>
  129. <!--
  130. <tr>
  131. <td valign="top">mapper</td>
  132. <td valign="top">A mapper to rename jar files during signing</td>
  133. <td valign="top" align="center">No, and only one can be supplied</td>
  134. </tr>
  135. -->
  136. </table>
  137. <h3>Examples</h3>
  138. <blockquote><pre>
  139. &lt;signjar jar=&quot;${dist}/lib/ant.jar&quot;
  140. alias=&quot;apache-group&quot; storepass=&quot;secret&quot;/&gt;
  141. </pre></blockquote>
  142. <p>
  143. signs the ant.jar with alias &quot;apache-group&quot; accessing the
  144. keystore and private key via &quot;secret&quot; password.
  145. </p>
  146. <hr>
  147. <p align="center">Copyright &copy; 2000-2005 The Apache Software Foundation. All rights
  148. Reserved.</p>
  149. </body>
  150. </html>