com.sun.javacard.ant.tasks
Class APDUToolTask

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended byorg.apache.tools.ant.taskdefs.Java
              extended bycom.sun.javacard.ant.tasks.JavacardTaskBase
                  extended bycom.sun.javacard.ant.tasks.APDUToolTask
Direct Known Subclasses:
DeployCapTask

public class APDUToolTask
extends JavacardTaskBase

This class encapsulates call to APDUTool.


Field Summary
protected  boolean checkForDownloadFailure
          Indicates if download in cref is to be verified
protected  java.lang.String crefExecutable
          cRef executable name and path
protected  java.lang.String inEEFile
          input EEPROM file name (optional)
protected  java.lang.String outEEFile
          output EEPROM file name
protected  java.lang.String scriptFileName
          Fully qualified script file name
 
Fields inherited from class com.sun.javacard.ant.tasks.JavacardTaskBase
bundleName, messages, noBanner, version
 
Fields inherited from class org.apache.tools.ant.taskdefs.Java
redirector, redirectorElement
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
APDUToolTask()
           
 
Method Summary
protected  void checkForFailures()
          If all responses from the card or cref are expected to be 9000, this method is used to verify that.
 void execute()
          Executes the task
protected  void initCard()
          This method starts cref.
protected  void sendAPDUSToCard(boolean checkForErrors)
          Runs the APDUTool to download the APDU script in cref.
 void setCheckDownloadFailure(boolean on)
          Sets/resets the checkForDownloadFailure flag
 void setCrefExe(java.lang.String crefExe)
          Sets the name and path for cref executable
 void setInEEFile(java.lang.String inFileName)
          Sets the EEPROM input file name
 void setOutEEFile(java.lang.String outFileName)
          Sets the EEPROM output file name
 void setScriptFile(java.lang.String scriptFileName)
          Sets the APDU script file name
 
Methods inherited from class com.sun.javacard.ant.tasks.JavacardTaskBase
setNoBanner, setupCommonOptions, setVersion
 
Methods inherited from class org.apache.tools.ant.taskdefs.Java
addAssertions, addConfiguredRedirector, addEnv, addSysproperty, addSyspropertyset, clearArgs, createArg, createBootclasspath, createClasspath, createJvmarg, createPermissions, createWatchdog, executeJava, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, maybeSetResultPropertyValue, run, setAppend, setArgs, setClassname, setClasspath, setClasspathRef, setDir, setError, setErrorProperty, setFailonerror, setFork, setInput, setInputString, setJar, setJvm, setJvmargs, setJVMVersion, setLogError, setMaxmemory, setNewenvironment, setOutput, setOutputproperty, setResultProperty, setSpawn, setTimeout, setupRedirector
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scriptFileName

protected java.lang.String scriptFileName
Fully qualified script file name


outEEFile

protected java.lang.String outEEFile
output EEPROM file name


inEEFile

protected java.lang.String inEEFile
input EEPROM file name (optional)


crefExecutable

protected java.lang.String crefExecutable
cRef executable name and path


checkForDownloadFailure

protected boolean checkForDownloadFailure
Indicates if download in cref is to be verified

Constructor Detail

APDUToolTask

public APDUToolTask()
Method Detail

setCheckDownloadFailure

public void setCheckDownloadFailure(boolean on)
Sets/resets the checkForDownloadFailure flag

Parameters:
on - switches the checkForDownloadFailure on or off

setOutEEFile

public void setOutEEFile(java.lang.String outFileName)
Sets the EEPROM output file name

Parameters:
outFileName - is the EEPROM file name

setInEEFile

public void setInEEFile(java.lang.String inFileName)
Sets the EEPROM input file name

Parameters:
inFileName - is the EEPROM file name

setScriptFile

public void setScriptFile(java.lang.String scriptFileName)
Sets the APDU script file name

Parameters:
scriptFileName - is the script file name

setCrefExe

public void setCrefExe(java.lang.String crefExe)
Sets the name and path for cref executable

Parameters:
crefExe - is fully qualified name and path for cref exe

initCard

protected void initCard()
                 throws org.apache.tools.ant.BuildException
This method starts cref. In case we want to start a card in order to download the APDU script in the card, a subclass can be written which can override this method to initialize a card instead of cref.

Throws:
org.apache.tools.ant.BuildException

sendAPDUSToCard

protected void sendAPDUSToCard(boolean checkForErrors)
                        throws org.apache.tools.ant.BuildException
Runs the APDUTool to download the APDU script in cref. A subclass of this class may override this method to use some other tool to send APDUs to cref or a smart card.

Parameters:
checkForErrors - could be set to true if all responses that come back from the card are expected to be 9000 and we need to verify this
Throws:
org.apache.tools.ant.BuildException

checkForFailures

protected void checkForFailures()
                         throws org.apache.tools.ant.BuildException
If all responses from the card or cref are expected to be 9000, this method is used to verify that. And if any response is other than 9000, this method throws BuildException that download failed.

Throws:
org.apache.tools.ant.BuildException

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Executes the task

Throws:
org.apache.tools.ant.BuildException


Copyright © 2005 Sun Microsystems, Inc. 4150 Network Circle,
Santa Clara, CA-95054, U.S.A. All Rights Reserved.