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.

Start Eclipse. Sample_Platform and Sample_Device must already be created.
  1. Import the SignatureMessageRecovery project into your workspace. If the build doesn't start automatically, start it manually.
  2. In Java Card View, double-click on Sample_Device. In the Properties for Sample_Device dialog, select the CREF tab:
    1. Select Do not open APDU console.
    2. Click OK.
  3. 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:
    1. In the Package Explorer view, click SignatureMessageRecovery project.
    2. Right-click on the Java Card project and select Java Card and CAP Files Settings.
    3. Select a CAP file from the list that appears in the Java Card CAP Files page.
    4. Click SignatureMessageRecovery and select Edit.
    5. In the Edit mode, select Compact CAP File.
    6. Click Next>.
    7. Select ScriptGen slide and select the Suppress "PowerDown;" APDU command at the end of CAP script check box.
    8. Click Finish and select Apply and Close.
  4. Create the first Run Configuration for this project. In the top menu, select Run and Run Configurations...
  5. In the Run Configurations dialog:
    1. Right-click on Java Card Project Run and select New.
    2. In the Name field, enter SignatureMessageRecovery_PartRec
    3. Click Browse..., select the SignatureMessageRecovery project, and click OK.
    4. Select Start simulator.
    5. In the Scripts to be executed on simulator list box, add the following scripts:
      • cap-com.sun.jcclassic.samples.signaturemessagerecovery.script from JC_HOME_SIMULATOR\samples\classic_applets\SignatureMessageRecovery\applet\apdu-scripts

      • sigMsgPartRec.scr from the same directory.

    6. Click Apply and Close
  6. Create the second Run Configuration for this project. In the top menu, select Run and Run Configurations...
  7. In the Run Configurations dialog:
    1. Right-click on Java Card Project Run and select New.
    2. In the Name field, enter SignatureMessageRecovery_FullRec
    3. Click Browse..., select the SignatureMessageRecovery project, and click OK.
    4. Select Start simulator.
    5. In the Scripts to be executed on simulator list box, add the following scripts:
      • cap-com.sun.jcclassic.samples.signaturemessagerecovery.script from JC_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)

    6. Click Apply and Close
  8. 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.

  9. 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.