11 Running the Samples in Eclipse

Before running the samples, please ensure you have read the Configuration Before Running the Samples section. The following sections describe the Java Card Development Kit samples in order of increasing complexity and provide procedures for running them:

Running the HelloWorld Sample in Eclipse

Run the HelloWorld sample using the Java client application.

Start Eclipse. Java_Card_Simulator_1 must have already been created.

  1. Using the File menu, select Import > General > Projects from Folder or Archive, and select the applet directory from the HelloWorld project, to import the HelloWorld Java Card project into your workspace. If the build doesn’t start automatically, start it manually.

    The build places the Converter output files (.cap, .jca, and .exp) in the deliverables directory.

  2. Using the File menu, select Import > General > Projects from Folder or Archive, and select the client directory from the HelloWorld project, to import the HelloWorld Java client into your workspace.

  3. If you do not see the Java Card view, go to the Window menu, select Show View > Other… In the list, expand Oracle Java Card SDK and select Java Card view.

  4. In the Java Card View, right-click on Java_Card_Simulator_1 and select Start.

    The Simulator starts and you can see the output in the Console view.

  5. Using the File menu, select Import > Run/Debug > Launch Configurations, select the HelloWorld sample directory and check file HelloWorld.launch to import the HelloWorld Java client launch configuration into Eclipse.

  6. Using the Run menu, select Run Configurations… or Debug Configurations… to run or debug the imported HelloWorld configuration

Running the Channels Sample in Eclipse

Run the Channels sample using the Java client application.

Start Eclipse. Java_Card_Simulator_1 must have already been created.

  1. Using the File menu, select Import > General > Projects from Folder or Archive and select the applet directory from the Channels project to import the Channels Java Card project into your workspace. If the build doesn’t start automatically, start it manually.

    The build puts the output from the converter (cap, jca, and exp) files in the deliverables directory.

  2. Using the File menu, select Import > General > Projects from Folder or Archive, and select the client directory from the Channels project, to import the Channels Java client into your workspace.

  3. If you do not see the Java Card view, go to the Window menu and select Show View > Other… In the list, expand Oracle Java Card SDK and select Java Card view.

  4. In the Java Card View, right-click on Java_Card_Simulator_1 and select Start. The Simulator starts and you can see the output in the Console view.

  5. Using the File menu, select Import > Run/Debug > Launch Configurations, select the Channels sample directory and check the file Channels.launch to import the Channels Java client launch configuration into Eclipse.

  6. Using the Run menu, select Run Configurations … or Debug Configurations … to run or debug the imported Channels configuration.

Running the Utility Sample in Eclipse

Run the Utility sample using the Java client application.

Start Eclipse. Java_Card_Simulator_1 must have already been created.

  1. Using the File menu, select Import > General > Projects from Folder or Archive and select the applet directory from the Utility project to import the Utility Java Card project into your workspace. If the build doesn’t start automatically, start it manually.

    The build puts the output from the converter (cap, jca, and exp files) in the deliverables directory.

  2. Using the File menu, select Import > General > Projects from Folder or Archive, and select the client directory from the Utility project, to import the Utility Java client into your workspace.

  3. If you do not see the Java Card view, go to the Window menu, select Show View > Other… In the list, expand Oracle Java Card SDK and select Java Card view.

  4. In the Java Card View, right-click on Java_Card_Simulator_1 and select Start. The Simulator starts and you can see the output in the Console view.

  5. Using the File menu, select Import > Run/Debug > Launch Configurations, select the Utility sample directory and check file Utility.launch to import the Utility Java client launch configuration into Eclipse.

  6. Using Run menu, select Run Configurations … or Debug Configurations … to run or debug the imported Utility configuration.

Running the Wallet Sample in Eclipse

Run the Wallet sample using the Java client application.

Start Eclipse. Java_Card_Simulator_1 must have already been created.

  1. Using the File menu, select Import > General > Projects from Folder or Archive and select the applet directory from the Wallet project to import the Wallet Java Card project into your workspace. If the build doesn’t start automatically, start it manually.

    The build puts the output from the converter (cap, jca, and exp files) in the deliverables directory.

  2. Using the File menu, select Import > General > Projects from Folder or Archive, and select the client directory from the Wallet project, to import the Wallet Java client into your workspace.

  3. If you do not see the Java Card view, go to the Window menu, select Show View > Other… In the list, expand Oracle Java Card SDK and select Java Card view.

  4. In the Java Card View, right-click on Java_Card_Simulator_1 and select Start. The Simulator starts and you can see the output in the Console view.

  5. Using the File menu, select Import > Run/Debug > Launch Configurations, select the Wallet sample directory and check file Wallet.launch to import the Wallet Java client launch configuration into Eclipse.

  6. Using the Run menu, select Run Configurations … or Debug Configurations … to run or debug the imported Wallet configuration.

Running the ObjectDeletion Sample in Eclipse

Run the ObjectDeletion sample using the Java client application.

Start Eclipse. Java_Card_Simulator_1 must have already been created.

  1. Using the File menu, select Import > General > Projects from Folder or Archive and select the applet directory from the ObjectDeletion project to import the ObjectDeletion Java Card project into your workspace. If the build doesn’t start automatically, start it manually.

    The build puts the output from the converter (cap, jca, and exp files) in the deliverables directory.

  2. Using the File menu, select Import > General > Projects from Folder or Archive, and select the client directory from the ObjectDeletion project, to import the ObjectDeletion Java client into your workspace.

  3. If you do not see the Java Card view, go to the Window menu, select Show View > Other… In the list, expand Oracle Java Card SDK and select Java Card view.

  4. In the Java Card View, right-click on Java_Card_Simulator_1 and select Start. The Simulator starts and you can see the output in the Console view.

  5. Using the File menu, select Import > Run/Debug > Launch Configurations, select the ObjectDeletion sample directory and check the file ObjectDeletion.launch to import the ObjectDeletion Java client launch configuration into Eclipse.

  6. Using the Run menu, select Run Configurations … or Debug Configurations … to run or debug the imported ObjectDeletion configuration.

Running the SignatureMessageRecovery Sample in Eclipse

Run the SignatureMessageRecovery sample using the Java client application.

Start Eclipse. Java_Card_Simulator_1 must have already been created.

  1. Using the File menu, select Import > General > Projects from Folder or Archive and select the applet directory from the SignatureMessageRecovery project to import the SignatureMessageRecovery Java Card project into your workspace. If the build doesn’t start automatically, start it manually.

    The build puts the output from the converter (cap, jca, and exp files) in the deliverables directory.

  2. Using the File menu, select Import > General > Projects from Folder or Archive, and select the client directory from the SignatureMessageRecovery project, to import the SignatureMessageRecovery Java client into your workspace

  3. If you do not see the Java Card view, go to the Window menu, select Show View > Other… In the list, expand Oracle Java Card SDK and select Java Card view.

  4. In the Java Card view, right-click on Java_Card_Simulator_1 and select Start. The Simulator starts and you can see the output in the Console view.

  5. Using the File menu, select Import > Run/Debug > Launch Configurations, select the SignatureMessageRecovery sample directory, and select the SignatureMessageRecovery.launch file to import the SignatureMessageRecovery Java client launch configuration into Eclipse.

  6. Using the Run menu, select Run Configurations… or Debug Configurations… to run or debug the imported SignatureMessageRecovery configuration.

Signing with Message Recovery

The order of operations for signing a message is as follows:

  1. The user invokes a combination of the update and sign methods to generate a signature based on message data provided by the user.

  2. The sign method returns an indication to the user of the portion of the message that was included as padding in the signature.

    This is required so that the user knows what remaining data must still be sent along with the signature block.

Verifying with Message Recovery

The order of operations for verifying a signed message is as follows:

  1. The user initializes the signature object with signature at the very beginning so it can get the recoverable data at the earliest.
  2. The user invokes a combination of the update and verify methods to verify the signature based on the message data provided by the user.
  3. The verify method verifies the signature by comparing the accumulated hash with the hash in the message representative recovered during initialization.

Running the ArrayViews Sample in Eclipse

Run the ArrayViews sample using the Java client application.

Start Eclipse. Java_Card_Simulator_1 must have already been created.

  1. Using the File menu, select Import > General > Projects from Folder or Archive and select the applet directory from the ArrayViews project to import the ArrayViews Java Card project into your workspace. If the build doesn’t start automatically, start it manually.

    The build puts the output from the converter (cap, jca, and exp) files in the deliverables directory.

  2. Using the File menu, select Import > General > Projects from Folder or Archive, and select the client directory from the ArrayViews project, to import the ArrayViews Java client into your workspace.

  3. If you do not see the Java Card view, go to the Window menu, select Show View > Other… In the list, expand Oracle Java Card SDK and select Java Card view.

  4. In the Java Card view, right-click on Java_Card_Simulator_1 and select Start. The Simulator starts and you can see the output in the Console view.

  5. Using the File menu, select Import > Run/Debug > Launch Configurations, select the ArrayViews sample directory and check the file ArrayViews.launch to import the ArrayViews Java client launch configuration into Eclipse.

  6. Using the Run menu, select Run Configurations … or Debug Configurations … to run or debug the imported ArrayViews configuration.