ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1221901 - in /ant/core/trunk: CONTRIBUTORS WHATSNEW contributors.xml manual/Tasks/signjar.html src/main/org/apache/tools/ant/taskdefs/SignJar.java
Date Wed, 21 Dec 2011 22:07:49 GMT
Author: bodewig
Date: Wed Dec 21 22:07:49 2011
New Revision: 1221901

URL: http://svn.apache.org/viewvc?rev=1221901&view=rev
Log:
provide control over signature and digest algorithms in <signjar>.  Submitted by Wang
Weijun.  PR 52344

Modified:
    ant/core/trunk/CONTRIBUTORS
    ant/core/trunk/WHATSNEW
    ant/core/trunk/contributors.xml
    ant/core/trunk/manual/Tasks/signjar.html
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SignJar.java

Modified: ant/core/trunk/CONTRIBUTORS
URL: http://svn.apache.org/viewvc/ant/core/trunk/CONTRIBUTORS?rev=1221901&r1=1221900&r2=1221901&view=diff
==============================================================================
--- ant/core/trunk/CONTRIBUTORS (original)
+++ ant/core/trunk/CONTRIBUTORS Wed Dec 21 22:07:49 2011
@@ -359,6 +359,7 @@ Victor Toni
 Vincent Legoll
 Volker Leidl
 Waldek Herka
+Wang Weijun
 Will Wang
 William Bernardet
 William Ferguson

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=1221901&r1=1221900&r2=1221901&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Wed Dec 21 22:07:49 2011
@@ -167,6 +167,10 @@ Other changes:
    be used to make the task sleep between retry attempts.
    Bugzilla Report 52076.
 
+ * <signjar> has new attributes that control the signature and digest
+   algorithms.
+   Bugzilla Report 52344.
+
 Changes from Ant 1.8.1 TO Ant 1.8.2
 ===================================
 

Modified: ant/core/trunk/contributors.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/contributors.xml?rev=1221901&r1=1221900&r2=1221901&view=diff
==============================================================================
--- ant/core/trunk/contributors.xml (original)
+++ ant/core/trunk/contributors.xml Wed Dec 21 22:07:49 2011
@@ -1445,6 +1445,10 @@
     <last>Leidl</last>
   </name>
   <name>
+    <first>Wang</first>
+    <last>Weijun</last>
+  </name>
+  <name>
     <first>Will</first>
     <last>Wang</last>
   </name>

Modified: ant/core/trunk/manual/Tasks/signjar.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/manual/Tasks/signjar.html?rev=1221901&r1=1221900&r2=1221901&view=diff
==============================================================================
--- ant/core/trunk/manual/Tasks/signjar.html (original)
+++ ant/core/trunk/manual/Tasks/signjar.html Wed Dec 21 22:07:49 2011
@@ -158,6 +158,16 @@ block</td>
       <em>since Ant 1.8.0</em>.</td>
     <td align="center" valign="top">No; default false</td>
   </tr>  
+  <tr>
+    <td valign="top">sigalg</td>
+    <td valign="top">name of signature algorithm</td>
+    <td valign="top" align="center">No</td>
+  </tr>
+  <tr>
+    <td valign="top">digestalg</td>
+    <td valign="top">name of digest algorithm</td>
+    <td valign="top" align="center">No</td>
+  </tr>
 </table>
 <h3>Parameters as nested elements</h3>
 <table border="1" cellpadding="2" cellspacing="0">
@@ -231,6 +241,24 @@ all be copied to this directory, not to 
 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>
+  <blockquote><pre>
+&lt;signjar
+    alias="testonly" keystore="testkeystore"
+    storepass="apacheant"
+    sigalg="MD5withRSA"
+    digestalg="SHA1"&gt;
+  &lt;path&gt;
+    &lt;fileset dir="dist" includes="**/*.jar" /&gt;
+  &lt;/path&gt;
+&lt;/signjar&gt;
+</pre></blockquote>
+<p>
+Sign all the JAR files in dist/**/*.jar using the digest algorithm SHA1 and the
+signature algorithm MD5withRSA. This is especially useful when you want to use
+the JDK 7 jarsigner (which uses SHA256 and SHA256withRSA as default) to create
+signed jars that will be deployed on platforms not supporting SHA256 and
+SHA256withRSA.
+</p>
 <h3>About timestamp signing</h3>
 
 <p>

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SignJar.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SignJar.java?rev=1221901&r1=1221900&r2=1221901&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SignJar.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SignJar.java Wed Dec 21 22:07:49
2011
@@ -110,6 +110,16 @@ public class SignJar extends AbstractJar
     private boolean force = false;
 
     /**
+     * signature algorithm
+     */
+    private String sigAlg;
+
+    /**
+     * digest algorithm
+     */
+    private String digestAlg;
+
+    /**
      * error string for unit test verification: {@value}
      */
     public static final String ERROR_TODIR_AND_SIGNEDJAR
@@ -276,6 +286,38 @@ public class SignJar extends AbstractJar
     }
 
     /**
+     * Signature Algorithm; optional
+     *
+     * @param sigAlg the signature algorithm
+     */
+    public void setSigAlg(String sigAlg) {
+        this.sigAlg = sigAlg;
+    }
+
+    /**
+     * Signature Algorithm; optional
+     */
+    public String getSigAlg() {
+        return sigAlg;
+    }
+
+    /**
+     * Digest Algorithm; optional
+     *
+     * @param digestAlg the digest algorithm
+     */
+    public void setDigestAlg(String digestAlg) {
+        this.digestAlg = digestAlg;
+    }
+
+    /**
+     * Digest Algorithm; optional
+     */
+    public String getDigestAlg() {
+        return digestAlg;
+    }
+
+    /**
      * sign the jar(s)
      *
      * @throws BuildException on errors
@@ -420,6 +462,16 @@ public class SignJar extends AbstractJar
             addValue(cmd, "-sectionsonly");
         }
 
+        if (sigAlg != null) {
+            addValue(cmd, "-sigalg");
+            addValue(cmd, sigAlg);
+        }
+
+        if (digestAlg != null) {
+            addValue(cmd, "-digestalg");
+            addValue(cmd, digestAlg);
+        }
+
         //add -tsa operations if declared
         addTimestampAuthorityCommands(cmd);
 



Mime
View raw message