The TclSC Smart Card Extension enables rapid smart card application design and development using the Tcl scripting language. Using TclSC one can directly access a smart card via a PC/SC-compliant smart card service provider (SSP) and smart card reader or one can develop smart card applications using built-in smart card emulators. The TclSC extension currently consists of the following command sets:
- iso7816 - ISO 7816-4 emulation including some non-standard but useful commands.
- multiflex - access to a Schlumberger Multiflex general-purpose card.
- gpk2000 - access to a Gemplus GPK2000 cryptographic card
- cryptoflex - access to a Schlumberger Cryptoflex cryptographic card
- starcos - access to a Giesecke & Devrient STARCOS-SPK cryptographic card
- payflex - access to a Schlumberger Payflex electronic purse card
- sc - commands to manipulate virtual smart cards and input to and output from physical smart cards
The smart card interfaces simply surface the command sets of their respective smart cards. For example, to present a PIN to a Multiflex smart card from a Tcl script one might code
multiflex::verifyPIN {1 2 3 4}
or to sign a hash with a public key on a GPK2000 card one might code
gpk2000::publicKeySign $hash signature
Download
The TclSC package is built on top of Tcl and the Microsoft PC/SC smart card architecture. You will need to install:
THIS PACKAGE IS UNDER ACTIVE CONSTRUCTION.
THIS RELEASE IS "PRE-ALPHA" AND FOR EARLY USER FEEDBACK.
Download
tclsc.zip of 5/3/98
Extending TclSC
To add a new emulator or smart card to the TclSC package is relatively straightforward. Tcl namespaces are used to isolate the commands from the interpreter. To get started, copy template.c to yourcardtype.c, then start editing within this file. Change the name of the templateInit routine to yourcardtype, add the commands that you need and compile the code. Use the Multiflex and GPK2000 code as examples.
Some assumptions about coding are:
- Tcl objects are used throughout.
- TCL_ERROR is only returned when a Tcl specific error is detected. If a card specific error is detected, then the appropriate card error will be returned and not cause the Tcl interpreter to force an exception and cancel the script execution.
- Smart card errors can either be reported as a numeric error status or as a text string. There is a common error reporting routine that will take this into account report status in the proper form.
- The only cryptographic algorithm supported is DES. Also there is not a standard list of cryptographic algorithms that smart card vendors use.
- Use the function header supplied in the template. Internal documentation is automatically generated.
Copyright © 1998 Ace Wrecking & Software All rights reserved