Browse Source

BZ 62534 add support for -provider* args of keytool

master
Stefan Bodewig 6 years ago
parent
commit
a5796b5db0
4 changed files with 104 additions and 0 deletions
  1. +4
    -0
      WHATSNEW
  2. +23
    -0
      manual/Tasks/signjar.html
  3. +23
    -0
      manual/Tasks/verifyjar.html
  4. +54
    -0
      src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java

+ 4
- 0
WHATSNEW View File

@@ -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
=====================================



+ 23
- 0
manual/Tasks/signjar.html View File

@@ -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">


+ 23
- 0
manual/Tasks/verifyjar.html View File

@@ -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">


+ 54
- 0
src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java View File

@@ -116,6 +116,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
*
@@ -230,6 +237,39 @@ public abstract class AbstractJarSignerTask extends Task {
return path.createPath();
}

/**
* 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)
*/
@@ -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");
}
}

/**


Loading…
Cancel
Save