| Home | Quick Start | Concepts | JCOP Shell | APIs | JCOPsim | Specifications | Command Line | FAQ | Release Notes | |
JCOP Shell TutorialThe sections below provide an introduction on how to use the basic functionality of the JCOP Shell ("JCShell").
IntroductionThe JCShell is a powerful tool to interact with your JavaCard. You can type commands interactively or you can run scripts against a JavaCard. The JCShell allows you to exercise functions of a JavaCard on the APDU level. The Open Platform functionality is already available in the shell. APDU commands of custom applets can be easly integrated by either writing simple scripts or by extending the shell functionality with a plugin. Command Prompts
When the JCShell starts, it will display a simple prompt, designated by a
The JCShell can also connect to the JCOP emulation (JC32) instead of connecting to a
real card. This can be done by using the
Remark: Before you execute any command you might want to enable the trace mode of the
JCShell to make more information such as APDUs going back and forth visible. This is
done by the command Interactive Help
At any time during the execution of the JCShell, interactive online help to all
commands is available by typing Generic Commands
Some commands are only valid if a particular JCShell plugin has been activated. For
instance, the CardManager plugin indicated by the command prompt
/atr
/cap-info
/card
/close
/list-vars
/set-var
/mode
/select
/send
/terminal
/help
?
quit
Remarks: The JCShell supports automatic command completion. The operator
JCShell PluginsIn the JCShell, a plugin is the off-card representative of an applet on the card: It provides a convenient shell interface to the commands known to the respective applet. In the case of an e-purse application, it may provide commands like load or purchase to execute the complete debit or credit functions of the applet, thus completely hiding the complexities of the respective application inside of the plugin. How plugins can be developed and used in the JCShell is not covered in this tutorial. One particularly important plugin, however, is the one dealing with the OpenPlatform CardManager. It's functionality allows to perform card management operations such as applet loading, installation or deletion. Open Platform CardManager Plugin
This plugin handles all commands necessary to make effective use of an OpenPlatform
card. It's identification is
init-update
ext-auth
upload
install
delete
card-info
set-applet
set-state
put-key
put-keyset
change-pin
unblock-pin
set-key
get-cplc A Sample JCShell SessionThe following sequence of JCShell commands represents a typical shell session in which an applet is loaded onto a card, a command is sent to the applet for testing purposes and finally the applet is deleted.
Switch trace mode on and connect to a PC/SC smart card reader
Reset the card (request ATR) and select the CardManager
Set the keys in key set 255 of the JCShell for authentication later on
Begin authentication using the appropriate key set
Complete authentication
Upload the package holding the applet
Install the applet in the package
Display the card registry to check if the applet is loaded and installed
Select the applet
Send a command to the applet (e.g. for testing the applet)
Select the CardManager again
Do authentication again
Delete the applet and the package
Display the card registry to check if the package/applet is gone Further InformationJCShell is mainly intended for developers who have a good knowledge about smart cards and also about the JavaCard and Open Platform standards. For more information on the low-level capabilities, e.g. scripting capabilities, or control language syntax, we suggest the reading of the companion document providing more details on these aspects. | |
|
| |
| Top | Legal Disclaimer | Copyright (c) 2001, 2002, 2003, 2004 IBM Corporation. All rights reserved. | Version 1.0.3.3 (200502081256). |