Running the PhotoCard Sample from the Command Line
To run the PhotoCard sample:
-
Open a Command Prompt window and perform the following:
-
Navigate to the
JC_HOME_SIMULATOR\bindirectory. -
Start the simulator by using the following command at the command prompt:
cref -o demoee
Starting the simulator with the
-ooption and filename causes the simulator to save the EEPROM contents to a file nameddemoee. -
-
Open a second Command Prompt window and perform the following:
-
Set
ANT_HOME(path to ant install folder),JC_HOME_TOOLSandJC_HOME_SIMULATOR(path to JCDK install folder) as environment variables. -
Navigate to the
JC_HOME_SIMULATOR\samples\classic_applets\PhotoCard\appletdirectory. -
Enter the following command at the command prompt:
ant allIn this sample's
appletdirectory, theantallcommand executes the APDU script, installs the photocard application, and creates an output file (default.out) in theappletdirectory.
-
-
Verify that the contents of the output file in the
appletdirectory are the same as the contents of thephotocard-applet.expected.outfile. -
In the
crefCommand Prompt window, restart the simulator by using the following command:cref -z -i demoeeStarting the simulator with the
-zand-ioptions and filename causes the simulator to use the contents of thedemoeefile to initialize the EEPROM and to display the resource consumption statistics. -
In the applet Command Prompt window, perform the following:
-
Navigate to the
JC_HOME_SIMULATOR\samples\classic_applets\PhotoCard\clientdirectory. -
Enter the following command at the command prompt:
ant allIn this sample's
clientdirectory, theantallcommand executes the APDU script and generates an output file (actual_output.txt) in theclientdirectory.
-
-
Verify that the contents of the
actual_output.txtfile are the same as the contents of thephotocard-client.expected.outfile.Note:
Photo verification requires the
MessageDigestclass and SHA256 algorithm. If these are not available, theactual_output.txtfile will not contain the last line of thephotocard-client.expected.outfile (Photo is valid).Depending on the locale that is used, the presentation of photo sizes might differ between
actual_output.txtandphotocard-client.expected.out. For example,"21,280 bytes"versus"21.280 bytes".