ASF Bugzilla – Attachment 28085 Details for
Bug 52344
Add -sigalg and -digestalg support to the signjar task
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for sigalg and digestalg support
alg.patch (text/plain), 3.40 KB, created by
Wang Weijun
on 2011-12-19 07:23:03 UTC
(
hide
)
Description:
Patch for sigalg and digestalg support
Filename:
MIME Type:
Creator:
Wang Weijun
Created:
2011-12-19 07:23:03 UTC
Size:
3.40 KB
patch
obsolete
>Index: src/main/org/apache/tools/ant/taskdefs/SignJar.java >=================================================================== >--- src/main/org/apache/tools/ant/taskdefs/SignJar.java (revision 1215029) >+++ src/main/org/apache/tools/ant/taskdefs/SignJar.java (working copy) >@@ -110,6 +110,16 @@ > 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 @@ > } > > /** >+ * 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 @@ > 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); > >Index: manual/Tasks/signjar.html >=================================================================== >--- manual/Tasks/signjar.html (revision 1215029) >+++ manual/Tasks/signjar.html (working copy) >@@ -158,6 +158,16 @@ > <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,7 +241,26 @@ > 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> >+<signjar >+ alias="testonly" keystore="testkeystore" >+ storepass="apacheant" >+ sigalg="MD5withRSA" >+ digestalg="SHA1"> >+ <path> >+ <fileset dir="dist" includes="**/*.jar" /> >+ </path> >+</signjar> >+</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> >+<h3>About timestamp signing</h3> > > <p> > Timestamped JAR files are a new feature in Java1.5; a feature supported in Ant since
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 52344
:
28085
|
28086