Class VerifyJar
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.AbstractJarSignerTask
org.apache.tools.ant.taskdefs.VerifyJar
- All Implemented Interfaces:
Cloneable
JAR verification task.
For every JAR passed in, we fork jarsigner to verify
that it is correctly signed. This is more rigorous than just checking for
the existence of a signature; the entire certification chain is tested
- Since:
- Ant 1.7
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringno file message "Not found :"static final StringError output if there is a failure to verify the jar.Fields inherited from class AbstractJarSignerTask
alias, ERROR_NO_SOURCE, filesets, jar, JARSIGNER_COMMAND, keypass, keystore, maxMemory, storepass, storetype, strict, verboseModifier 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 ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidinit processing logic; this is retained through our execution(s)protected voidany cleanup logicvoidexecute()verify our jar filesvoidsetCertificates(boolean certificates) Ask for certificate information to be printedMethods inherited from class AbstractJarSignerTask
addArg, addArgument, addFileset, addSysproperty, addValue, bindToKeystore, createJarSigner, createPath, createUnifiedSourcePath, createUnifiedSources, declareSysProperty, getRedirector, hasResources, setAlias, setCommonOptions, setExecutable, setJar, setKeypass, setKeystore, setMaxmemory, setProviderArg, setProviderClass, setProviderName, setStorepass, setStoretype, setStrict, setVerboseModifier 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 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) get 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 Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeModifier and TypeMethodDescriptionfinal voidbindToOwner(Task owner) Bind a task to another; use this when configuring a newly created task to do work on behalf of another.Returns the container target of this task.Returns the wrapper used for runtime configuration.Returns the name to use in logging messages.Return the type of task.protected RuntimeConfigurableReturn the runtime configurable structure for this task.protected voidhandleErrorFlush(String output) Handles an error line by logging it with the WARN priority.protected voidhandleErrorOutput(String output) Handles an error output by logging it with the WARN priority.protected voidhandleFlush(String output) Handles output by logging it with the INFO priority.protected inthandleInput(byte[] buffer, int offset, int length) Handle an input request by this task.protected voidhandleOutput(String output) Handles output by logging it with the INFO priority.voidinit()Called by the project to let the task initialize properly.protected final booleanHas this task been marked invalid?voidLogs a message with the default (INFO) priority.voidLogs a message with the given priority.voidLogs a message with the given priority.voidLogs a message with the given priority.voidConfigures this task - if it hasn't been done already.final voidperform()Performs this task if it's still valid, or gets a replacement version and performs that otherwise.voidForce the task to be reconfigured from its RuntimeConfigurable.voidsetOwningTarget(Target target) Sets the target container of this task.voidSets the wrapper to be used for runtime configuration.voidsetTaskName(String name) Sets the name to use in logging messages.voidsetTaskType(String type) Sets the name with which the task has been invoked.Methods inherited from class ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProjectModifier and TypeMethodDescriptionclone()Returns the description of the current action.Returns the file/location where this task was defined.Returns the project to which this component belongs.voidsetDescription(String desc) Sets a description of the current action.voidsetLocation(Location location) Sets the file/location where this task was defined.voidsetProject(Project project) Sets the project object of this component.
-
Field Details
-
ERROR_NO_FILE
-
ERROR_NO_VERIFY
Error output if there is a failure to verify the jar.- See Also:
-
-
Constructor Details
-
VerifyJar
public VerifyJar()
-
-
Method Details
-
setCertificates
public void setCertificates(boolean certificates) Ask for certificate information to be printed- Parameters:
certificates- if true print certificates.
-
execute
verify our jar files- Overrides:
executein classTask- Throws:
BuildException- on error.
-
beginExecution
protected void beginExecution()Description copied from class:AbstractJarSignerTaskinit processing logic; this is retained through our execution(s)- Overrides:
beginExecutionin classAbstractJarSignerTask- Since:
- 1.10.3
-
endExecution
protected void endExecution()Description copied from class:AbstractJarSignerTaskany cleanup logic- Overrides:
endExecutionin classAbstractJarSignerTask- Since:
- 1.10.3
-