- Development Kit User Guide
- Setup, Samples and Tools
- Running the Samples
- Running the classic_applets Samples
- SignatureMessageRecovery Sample
- Running the SignatureMessageRecovery Sample in Eclipse
Running the SignatureMessageRecovery Sample in Eclipse
In this sample we create two run configurations for the same project, to run a different pair of scripts.
- Import the
SignatureMessageRecovery
project into your workspace. If the build doesn't start automatically, start it manually. - In Java Card View, double-click on Sample_Device. In the Properties for Sample_Device dialog, select the CREF tab:
- Select Do not open APDU console.
- Click OK.
- Before you configure, run, and start any script, you must change the PowerDown parameters for generating the script files. Otherwise, the simulator goes into the PowerDown mode after running the
cap-SignatureMessageRecovery.script
, and interrupts the execution of the following script files. To change the PowerDown parameters:- In the Package Explorer view, click
SignatureMessageRecovery
project. - Right-click on the Java Card project and select Java Card and CAP Files Settings.
- Select a CAP file from the list that appears in the Java Card CAP Files page.
- Click SignatureMessageRecovery and select Edit.
- In the Edit mode, select Compact CAP File.
- Click Next>.
- Select ScriptGen slide and select the Suppress "PowerDown;" APDU command at the end of CAP script check box.
- Click Finish and select Apply and Close.
- In the Package Explorer view, click
- Create the first Run Configuration for this project. In the top menu, select Run and Run Configurations...
- In the Run Configurations dialog:
- Right-click on Java Card Project Run and select New.
- In the Name field, enter SignatureMessageRecovery_PartRec
- Click Browse..., select the
SignatureMessageRecovery
project, and click OK. - Select Start simulator.
- In the Scripts to be executed on simulator list box, add the following scripts:
-
cap-com.sun.jcclassic.samples.signaturemessagerecovery.script
fromJC_HOME_SIMULATOR\samples\classic_applets\SignatureMessageRecovery\applet\apdu-scripts
-
sigMsgPartRec.scr
from the same directory.
-
- Click Apply and Close
- Create the second Run Configuration for this project. In the top menu, select Run and Run Configurations...
- In the Run Configurations dialog:
- Right-click on Java Card Project Run and select New.
- In the Name field, enter SignatureMessageRecovery_FullRec
- Click Browse..., select the
SignatureMessageRecovery
project, and click OK. - Select Start simulator.
- In the Scripts to be executed on simulator list box, add the following scripts:
-
cap-com.sun.jcclassic.samples.signaturemessagerecovery.script
fromJC_HOME_SIMULATOR\samples\classic_applets\SignatureMessageRecovery\applet\apdu-scripts
-
sigMsgFullRec.scr
from the same directory. (Note that this script is different from the first Run Configuration that you created)
-
- Click Apply and Close
- In the top menu, select Run and Run Configurations..., select SignatureMessageRecovery_PartRec, click Run.
Compare the output with the contents of the
sigMsgPartRec.expected.output
file. - In the top menu, select Run and Run Configurations..., select SignatureMessageRecovery_FullRec, click Run.
Compare the output with the contents of the
sigMsgFullRec.expected.output
file.