SignJar; a base class that can be used
for both signing and verifying JAR files using jarsigner
| Modifier and Type | Field and Description |
|---|---|
| private List | |
| protected String | alias
The alias of signer. |
| public static final String | ERROR_NO_SOURCE
error string for unit test verification: jar must be set through jar attribute or nested filesets |
| private String | executable
The executable to use instead of jarsigner. |
| protected Vector | filesets
the filesets of the jars to sign |
| protected File | jar
The name of the jar file. |
| protected static final String | JARSIGNER_COMMAND
name of JDK program we are looking for |
| protected String | keypass
password for the key in the store |
| protected String | keystore
The url or path of keystore file. |
| protected String | maxMemory
The maximum amount of memory to use for Jar signer |
| private Path | path
Path holding all non-filesets of filesystem resources we want to sign. |
| private String | providerArg
Values for the providerName, providerClass, and providerArg options. |
| private String | providerClass
Values for the providerName, providerClass, and providerArg options. |
| private String | providerName
Values for the providerName, providerClass, and providerArg options. |
| private RedirectorElement | redirector
redirector used to talk to the jarsigner program |
| protected String | storepass
password for the store |
| protected String | storetype
type of store,-storetype param |
| protected boolean | strict
strict checking |
| private Environment | sysProperties
Java declarations -J-Dname=value |
| protected boolean | verbose
verbose output |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addArg(Commandline.
the argument to add argAdds a nested <arg> element that can be used to specify command line arguments not supported via specific attributes. |
| protected void | addArgument(final ExecTask
command to manipulate cmd, Commandline.argument to add argadd an argument to a command |
| public void | |
| public void | |
| protected void | |
| protected void | |
| protected void | bindToKeystore(final ExecTask
command to configure cmd)bind to a keystore if the attributes are there |
| protected ExecTask | Returns: a task set up with the executable of jarsigner, failonerror=true and bound to our redirectorcreate the jarsigner executable task |
| public Path | |
| private RedirectorElement | |
| protected Path | Returns: a path that contains all files to signclone our path and add all explicitly specified FileSets as well, patch in the jar attribute as a new fileset if it is defined. |
| protected Vector | Returns: a vector of FileSet instancesclone our filesets vector, and patch in the jar attribute as a new fileset, if is defined |
| protected void | |
| protected void | |
| public RedirectorElement | |
| protected boolean | Returns: true if a path or fileset has been specified.Has either a path or a fileset been specified? |
| public void | |
| protected void | setCommonOptions(final ExecTask
command to configure cmd)these are options common to signing and verifying |
| public void | setExecutable(String
the command to invoke. executable)Sets the actual executable command to invoke, instead of the binary
|
| public void | |
| public void | setKeypass(final String
the password for the key (if different) keypass)password for private key (if different); optional |
| public void | |
| public void | setMaxmemory(String
a string indicating the maximum memory according to the JVM
conventions (e.g. 128m is 128 Megabytes) max)Set the maximum memory to be used by the jarsigner process |
| public void | setProviderArg(String
the value for the -providerArg command line argument providerArg)Sets the value for the -providerArg command line argument. |
| public void | setProviderClass(String
the value for the -providerClass command line argument providerClass)Sets the value for the -providerClass command line argument. |
| public void | setProviderName(String
the value for the -providerName command line argument providerName)Sets the value for the -providerName command line argument. |
| public void | setStorepass(final String
the password for the keystore storepass)password for keystore integrity; required |
| public void | |
| public void | |
| public void | setVerbose(final boolean
if true enable verbose output verbose)Enable verbose output when signing; optional: default false |
| additionalArgs | back to summary |
|---|---|
| private List<Commandline. | |
| alias | back to summary |
|---|---|
| protected String alias The alias of signer. | |
| ERROR_NO_SOURCE | back to summary |
|---|---|
| public static final String ERROR_NO_SOURCE error string for unit test verification: jar must be set through jar attribute or nested filesets | |
| executable | back to summary |
|---|---|
| private String executable The executable to use instead of jarsigner.
| |
| filesets | back to summary |
|---|---|
| protected Vector<FileSet> filesets the filesets of the jars to sign | |
| jar | back to summary |
|---|---|
| protected File jar The name of the jar file. | |
| JARSIGNER_COMMAND | back to summary |
|---|---|
| protected static final String JARSIGNER_COMMAND name of JDK program we are looking for | |
| keypass | back to summary |
|---|---|
| protected String keypass password for the key in the store | |
| keystore | back to summary |
|---|---|
| protected String keystore The url or path of keystore file. | |
| maxMemory | back to summary |
|---|---|
| protected String maxMemory The maximum amount of memory to use for Jar signer | |
| path | back to summary |
|---|---|
| private Path path Path holding all non-filesets of filesystem resources we want to sign.
| |
| providerArg | back to summary |
|---|---|
| private String providerArg Values for the providerName, providerClass, and providerArg options.
| |
| providerClass | back to summary |
|---|---|
| private String providerClass Values for the providerName, providerClass, and providerArg options.
| |
| providerName | back to summary |
|---|---|
| private String providerName Values for the providerName, providerClass, and providerArg options.
| |
| redirector | back to summary |
|---|---|
| private RedirectorElement redirector redirector used to talk to the jarsigner program | |
| storepass | back to summary |
|---|---|
| protected String storepass password for the store | |
| storetype | back to summary |
|---|---|
| protected String storetype type of store,-storetype param | |
| strict | back to summary |
|---|---|
| protected boolean strict strict checking
| |
| sysProperties | back to summary |
|---|---|
| private Environment sysProperties Java declarations -J-Dname=value | |
| verbose | back to summary |
|---|---|
| protected boolean verbose verbose output | |
| AbstractJarSignerTask | back to summary |
|---|---|
| public AbstractJarSignerTask() | |
| addArg | back to summary |
|---|---|
| public void addArg(Commandline. Adds a nested <arg> element that can be used to specify command line arguments not supported via specific attributes.
| |
| addArgument | back to summary |
|---|---|
| protected void addArgument(final ExecTask cmd, Commandline. add an argument to a command
| |
| addFileset | back to summary |
|---|---|
| public void addFileset(final FileSet set) Adds a set of files to sign
| |
| addSysproperty | back to summary |
|---|---|
| public void addSysproperty(Environment. Add a system property.
| |
| addValue | back to summary |
|---|---|
| protected void addValue(final ExecTask cmd, String value) add a value argument to a command | |
| beginExecution | back to summary |
|---|---|
| protected void beginExecution() init processing logic; this is retained through our execution(s) | |
| bindToKeystore | back to summary |
|---|---|
| protected void bindToKeystore(final ExecTask cmd) bind to a keystore if the attributes are there
| |
| createJarSigner | back to summary |
|---|---|
| protected ExecTask createJarSigner() create the jarsigner executable task
| |
| createPath | back to summary |
|---|---|
| public Path createPath() Adds a path of files to sign.
| |
| createRedirector | back to summary |
|---|---|
| private RedirectorElement createRedirector() Create the redirector to use, if any.
| |
| createUnifiedSourcePath | back to summary |
|---|---|
| protected Path createUnifiedSourcePath() clone our path and add all explicitly specified FileSets as well, patch in the jar attribute as a new fileset if it is defined.
| |
| createUnifiedSources | back to summary |
|---|---|
| protected Vector clone our filesets vector, and patch in the jar attribute as a new fileset, if is defined | |
| declareSysProperty | back to summary |
|---|---|
protected void declareSysProperty(ExecTask cmd, Environment.
| |
| endExecution | back to summary |
|---|---|
| protected void endExecution() any cleanup logic | |
| getRedirector | back to summary |
|---|---|
| public RedirectorElement getRedirector() get the redirector. Non-null between invocations of
| |
| hasResources | back to summary |
|---|---|
| protected boolean hasResources() Has either a path or a fileset been specified?
| |
| setAlias | back to summary |
|---|---|
| public void setAlias(final String alias) the alias to sign under; required
| |
| setCommonOptions | back to summary |
|---|---|
| protected void setCommonOptions(final ExecTask cmd) these are options common to signing and verifying
| |
| setExecutable | back to summary |
|---|---|
| public void setExecutable(String executable) Sets the actual executable command to invoke, instead of the binary
| |
| setJar | back to summary |
|---|---|
| public void setJar(final File jar) the jar file to sign; required
| |
| setKeypass | back to summary |
|---|---|
| public void setKeypass(final String keypass) password for private key (if different); optional
| |
| setKeystore | back to summary |
|---|---|
| public void setKeystore(final String keystore) keystore location; required
| |
| setMaxmemory | back to summary |
|---|---|
| public void setMaxmemory(String max) Set the maximum memory to be used by the jarsigner process
| |
| setProviderArg | back to summary |
|---|---|
| public void setProviderArg(String providerArg) Sets the value for the -providerArg command line argument.
| |
| setProviderClass | back to summary |
|---|---|
| public void setProviderClass(String providerClass) Sets the value for the -providerClass command line argument.
| |
| setProviderName | back to summary |
|---|---|
| public void setProviderName(String providerName) Sets the value for the -providerName command line argument.
| |
| setStorepass | back to summary |
|---|---|
| public void setStorepass(final String storepass) password for keystore integrity; required
| |
| setStoretype | back to summary |
|---|---|
| public void setStoretype(final String storetype) keystore type; optional
| |
| setStrict | back to summary |
|---|---|
| public void setStrict(boolean strict) do strict checking
| |
| setVerbose | back to summary |
|---|---|
| public void setVerbose(final boolean verbose) Enable verbose output when signing; optional: default false
| |