You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2018/09/28 16:30:22 UTC

[2/4] ant git commit: BZ 62534 add support for -provider* args of keytool

BZ 62534 add support for -provider* args of keytool


Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/a5796b5d
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/a5796b5d
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/a5796b5d

Branch: refs/heads/master
Commit: a5796b5db00092b41dfcad273230451973d38b4e
Parents: a746e13
Author: Stefan Bodewig <bo...@apache.org>
Authored: Fri Sep 28 18:07:16 2018 +0200
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Fri Sep 28 18:20:30 2018 +0200

----------------------------------------------------------------------
 WHATSNEW                                        |  4 ++
 manual/Tasks/signjar.html                       | 23 +++++++++
 manual/Tasks/verifyjar.html                     | 23 +++++++++
 .../ant/taskdefs/AbstractJarSignerTask.java     | 54 ++++++++++++++++++++
 4 files changed, 104 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/a5796b5d/WHATSNEW
----------------------------------------------------------------------
diff --git a/WHATSNEW b/WHATSNEW
index 9d96ca5..6085274 100644
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -24,6 +24,10 @@ Other changes:
  * the <modified> selector has a new built-in algorithm 'lastmodified'
    which computes a value based upon the lastmodified time of the file.
 
+ * signjar and verifyjar now support the -providerName, -providerClass
+   and -providerArg command line options of keytool via new attributes.
+   Bugzilla Report 65234
+
 Changes from Ant 1.9.12 TO Ant 1.9.13
 =====================================
 

http://git-wip-us.apache.org/repos/asf/ant/blob/a5796b5d/manual/Tasks/signjar.html
----------------------------------------------------------------------
diff --git a/manual/Tasks/signjar.html b/manual/Tasks/signjar.html
index 32315c1..f6a7a37 100644
--- a/manual/Tasks/signjar.html
+++ b/manual/Tasks/signjar.html
@@ -186,6 +186,29 @@ block</td>
     <td valign="top">name of digest algorithm</td>
     <td valign="top" align="center">No</td>
   </tr>
+  <tr>
+    <td valign="top">providername</td>
+    <td valign="top">name of a cryptographic service provider's name
+      when listed in the security properties file.
+      <em>since Ant 1.9.14</em>.</td>
+    <td valign="top" align="center">No</td>
+  </tr>
+  <tr>
+    <td valign="top">providerclass</td>
+    <td valign="top">name of a cryptographic service provider's master
+      class file when the service provider is not listed in the security
+      properties file.
+      <em>since Ant 1.9.14</em>.</td>
+    <td valign="top" align="center">No</td>
+  </tr>
+  <tr>
+    <td valign="top">providerarg</td>
+    <td valign="top">Represents an optional string input argument for
+      the constructor of provider_class_name. Ignored
+      if <code>providerclass</code> is not set.
+      <em>since Ant 1.9.14</em>.</td>
+    <td valign="top" align="center">No</td>
+  </tr>
 </table>
 <h3>Parameters as nested elements</h3>
 <table border="1" cellpadding="2" cellspacing="0">

http://git-wip-us.apache.org/repos/asf/ant/blob/a5796b5d/manual/Tasks/verifyjar.html
----------------------------------------------------------------------
diff --git a/manual/Tasks/verifyjar.html b/manual/Tasks/verifyjar.html
index 886075a..bf442b7 100644
--- a/manual/Tasks/verifyjar.html
+++ b/manual/Tasks/verifyjar.html
@@ -105,6 +105,29 @@ supported
       <em>since Ant 1.8.0</em>.</td>
     <td align="center" valign="top">No</td>
   </tr>  
+  <tr>
+    <td valign="top">providername</td>
+    <td valign="top">name of a cryptographic service provider's name
+      when listed in the security properties file.
+      <em>since Ant 1.9.14</em>.</td>
+    <td valign="top" align="center">No</td>
+  </tr>
+  <tr>
+    <td valign="top">providerclass</td>
+    <td valign="top">name of a cryptographic service provider's master
+      class file when the service provider is not listed in the security
+      properties file.
+      <em>since Ant 1.9.14</em>.</td>
+    <td valign="top" align="center">No</td>
+  </tr>
+  <tr>
+    <td valign="top">providerarg</td>
+    <td valign="top">Represents an optional string input argument for
+      the constructor of provider_class_name. Ignored
+      if <code>providerclass</code> is not set.
+      <em>since Ant 1.9.14</em>.</td>
+    <td valign="top" align="center">No</td>
+  </tr>
 </table>
 <h3>Parameters as nested elements</h3>
 <table border="1" cellpadding="2" cellspacing="0">

http://git-wip-us.apache.org/repos/asf/ant/blob/a5796b5d/src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java b/src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java
index b2fe8d4..b15d2bc 100644
--- a/src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java
+++ b/src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java
@@ -117,6 +117,13 @@ public abstract class AbstractJarSignerTask extends Task {
     private String executable;
 
     /**
+     * Values for the providerName, providerClass, and providerArg options.
+     *
+     * @since Ant 1.9.14
+     */
+    private String providerName, providerClass, providerArg;
+
+    /**
      * Set the maximum memory to be used by the jarsigner process
      *
      * @param max a string indicating the maximum memory according to the JVM
@@ -231,6 +238,39 @@ public abstract class AbstractJarSignerTask extends Task {
     }
 
     /**
+     * Sets the value for the -providerName command line argument.
+     *
+     * @param providerName the value for the -providerName command line argument
+     *
+     * @since Ant 1.9.14
+     */
+    public void setProviderName(String providerName) {
+        this.providerName = providerName;
+    }
+
+    /**
+     * Sets the value for the -providerClass command line argument.
+     *
+     * @param providerClass the value for the -providerClass command line argument
+     *
+     * @since Ant 1.9.14
+     */
+    public void setProviderClass(String providerClass) {
+        this.providerClass = providerClass;
+    }
+
+    /**
+     * Sets the value for the -providerArg command line argument.
+     *
+     * @param providerArg the value for the -providerArg command line argument
+     *
+     * @since Ant 1.9.14
+     */
+    public void setProviderArg(String providerArg) {
+        this.providerArg = providerArg;
+    }
+
+    /**
      * init processing logic; this is retained through our execution(s)
      */
     protected void beginExecution() {
@@ -347,6 +387,20 @@ public abstract class AbstractJarSignerTask extends Task {
             addValue(cmd, "-storetype");
             addValue(cmd, storetype);
         }
+        if (null != providerName) {
+            addValue(cmd, "-providerName");
+            addValue(cmd, providerName);
+        }
+        if (null != providerClass) {
+            addValue(cmd, "-providerClass");
+            addValue(cmd, providerClass);
+            if (null != providerArg) {
+                addValue(cmd, "-providerArg");
+                addValue(cmd, providerArg);
+            }
+        } else if (null != providerArg) {
+            log("Ignoring providerArg as providerClass has not been set");
+        }
     }
 
     /**