Package org.apache.tools.ant.taskdefs
Class AbstractJarSignerTask
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.AbstractJarSignerTask
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected StringThe alias of signer.static final Stringerror string for unit test verification: "jar must be set through jar attribute or nested filesets"the filesets of the jars to signprotected FileThe name of the jar file.protected static final Stringname of JDK program we are looking forprotected Stringpassword for the key in the storeprotected StringThe url or path of keystore file.protected StringThe maximum amount of memory to use for Jar signerprotected Stringpassword for the storeprotected Stringtype of store,-storetype paramprotected booleanstrict checkingprotected booleanverbose outputFields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds a nested <arg> element that can be used to specify command line arguments not supported via specific attributes.protected voidaddArgument(ExecTask cmd, Commandline.Argument arg) add an argument to a commandvoidaddFileset(FileSet set) Adds a set of files to signvoidAdd a system property.protected voidadd a value argument to a commandprotected voidinit processing logic; this is retained through our execution(s)protected voidbindToKeystore(ExecTask cmd) bind to a keystore if the attributes are thereprotected ExecTaskcreate the jarsigner executable taskAdds a path of files to sign.protected Pathclone our path and add all explicitly specified FileSets as well, patch in the jar attribute as a new fileset if it is defined.clone our filesets vector, and patch in the jar attribute as a new fileset, if is definedprotected voiddeclareSysProperty(ExecTask cmd, Environment.Variable property) protected voidany cleanup logicget the redirector.protected booleanHas either a path or a fileset been specified?voidthe alias to sign under; requiredprotected voidsetCommonOptions(ExecTask cmd) these are options common to signing and verifyingvoidsetExecutable(String executable) Sets the actual executable command to invoke, instead of the binaryjarsignerfound in Ant's JDK.voidthe jar file to sign; requiredvoidsetKeypass(String keypass) password for private key (if different); optionalvoidsetKeystore(String keystore) keystore location; requiredvoidsetMaxmemory(String max) Set the maximum memory to be used by the jarsigner processvoidsetProviderArg(String providerArg) Sets the value for the -providerArg command line argument.voidsetProviderClass(String providerClass) Sets the value for the -providerClass command line argument.voidsetProviderName(String providerName) Sets the value for the -providerName command line argument.voidsetStorepass(String storepass) password for keystore integrity; requiredvoidsetStoretype(String storetype) keystore type; optionalvoidsetStrict(boolean strict) do strict checkingvoidsetVerbose(boolean verbose) Enable verbose output when signing; optional: default falseMethods inherited from class org.apache.tools.ant.TaskbindToOwner, execute, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponentclone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
- 
Field Details- 
ERROR_NO_SOURCEerror string for unit test verification: "jar must be set through jar attribute or nested filesets"- See Also:
 
- 
JARSIGNER_COMMAND
- 
jarThe name of the jar file.
- 
aliasThe alias of signer.
- 
keystoreThe url or path of keystore file.
- 
storepasspassword for the store
- 
storetypetype of store,-storetype param
- 
keypasspassword for the key in the store
- 
verboseprotected boolean verboseverbose output
- 
strictprotected boolean strictstrict checking- Since:
- Ant 1.9.1
 
- 
maxMemoryThe maximum amount of memory to use for Jar signer
- 
filesets
 
- 
- 
Constructor Details- 
AbstractJarSignerTaskpublic AbstractJarSignerTask()
 
- 
- 
Method Details- 
setMaxmemorySet the maximum memory to be used by the jarsigner process- Parameters:
- max- a string indicating the maximum memory according to the JVM conventions (e.g. 128m is 128 Megabytes)
 
- 
setJar
- 
setAliasthe alias to sign under; required- Parameters:
- alias- the alias to sign under
 
- 
setKeystorekeystore location; required- Parameters:
- keystore- the keystore location
 
- 
setStorepasspassword for keystore integrity; required- Parameters:
- storepass- the password for the keystore
 
- 
setStoretypekeystore type; optional- Parameters:
- storetype- the keystore type
 
- 
setKeypasspassword for private key (if different); optional- Parameters:
- keypass- the password for the key (if different)
 
- 
setVerbosepublic void setVerbose(boolean verbose) Enable verbose output when signing; optional: default false- Parameters:
- verbose- if true enable verbose output
 
- 
setStrictpublic void setStrict(boolean strict) do strict checking- Parameters:
- strict- boolean
- Since:
- Ant 1.9.1
 
- 
addFilesetAdds a set of files to sign- Parameters:
- set- a set of files to sign
- Since:
- Ant 1.4
 
- 
addSyspropertyAdd a system property.- Parameters:
- sysp- system property.
 
- 
createPathAdds a path of files to sign.- Returns:
- a path of files to sign.
- Since:
- Ant 1.7
 
- 
setProviderNameSets the value for the -providerName command line argument.- Parameters:
- providerName- the value for the -providerName command line argument
- Since:
- Ant 1.10.6
 
- 
setProviderClassSets the value for the -providerClass command line argument.- Parameters:
- providerClass- the value for the -providerClass command line argument
- Since:
- Ant 1.10.6
 
- 
setProviderArgSets the value for the -providerArg command line argument.- Parameters:
- providerArg- the value for the -providerArg command line argument
- Since:
- Ant 1.10.6
 
- 
addArgAdds a nested <arg> element that can be used to specify command line arguments not supported via specific attributes.- Parameters:
- arg- the argument to add
- Since:
- Ant 1.10.6
 
- 
beginExecutionprotected void beginExecution()init processing logic; this is retained through our execution(s)
- 
endExecutionprotected void endExecution()any cleanup logic
- 
getRedirectorget the redirector. Non-null between invocations ofbeginExecution()andendExecution()- Returns:
- a redirector or null
 
- 
setExecutableSets the actual executable command to invoke, instead of the binaryjarsignerfound in Ant's JDK.- Parameters:
- executable- the command to invoke.
- Since:
- Ant 1.8.0
 
- 
setCommonOptionsthese are options common to signing and verifying- Parameters:
- cmd- command to configure
 
- 
declareSysPropertyprotected void declareSysProperty(ExecTask cmd, Environment.Variable property) throws BuildException - Parameters:
- cmd- command to configure
- property- property to set
- Throws:
- BuildException- if the property is not correctly defined.
 
- 
bindToKeystorebind to a keystore if the attributes are there- Parameters:
- cmd- command to configure
 
- 
createJarSignercreate the jarsigner executable task- Returns:
- a task set up with the executable of jarsigner, failonerror=true and bound to our redirector
 
- 
createUnifiedSources
- 
createUnifiedSourcePathclone our path and add all explicitly specified FileSets as well, patch in the jar attribute as a new fileset if it is defined.- Returns:
- a path that contains all files to sign
- Since:
- Ant 1.7
 
- 
hasResourcesprotected boolean hasResources()Has either a path or a fileset been specified?- Returns:
- true if a path or fileset has been specified.
- Since:
- Ant 1.7
 
- 
addValue
- 
addArgumentadd an argument to a command- Parameters:
- cmd- command to manipulate
- arg- argument to add
 
 
-