This is Cyberflex for Linux "starter's kit" 2.1 for Intel x86 processor.

Danny Kumamoto, Schlumberger APC, February 29, 2000.  This file is:
Copyright, 2000, Schlumberger, APC, All Rights Reserved.  You may copy
this file but this copyright notice must be preserved.


/* 
  Now the Linux starter's kit is distributed by CITI, the University of
  Michigan, at: 
  http://www.citi.umich.edu/projects/smartcard/cyberflex_starter
  Please contact us at smartcards@umich.edu if you have any questions.

    Nov. 21, 2000   CITI
*/


Requirements to run the binaries:

	Linux x86 (it is known to run on RedHat 6.1 x86)
	ELF 32-bit support (default for RedHat)
	libc5 dynamic library (normally installed for RedHat)
	libc6 dynamic library (normally installed for RedHat)
	Tk8.0 Tcl8.0 and X11 (normally installed for RedHat)
	PCSC-lite (RPC version, from www.linuxnet.com)
	Linux PCSC support card reader (Reflex 60 and Towitoko are tested)
	Cyberflex Open16K or Access smart cards
	

Almost all source files are publically available.  Source files not
publically available are the javacard* class files and mksolo, both of
which are enclosed as binaries (however, only mksolo is CPU
dependent).  For mksolo support for other CPU's and operating systems
(or if the class files do not work with your Java compiler), please
contact CITI at:

	mailto:smartcards@umich.edu

Or you may be able to get help from the MUSCLE mailing list:

	mailto:sclinux@linuxnet.com

You can buy Reflex 60 readers and Cyberflex Access cards at:

	http://www.cardstore.slb.com/



		Source files


I've enclosed source files for Xcard, and drivers for SLB Reflex 60
and Towitoko ChipDrive.  The DES routines are pre-compiled and
included as a convenience (your system may already have DES installed
as libdes.*).  The original source locations are:

This tar file has the main Cyberflex Access loader in the "pay" program:
http://www.citi.umich.edu/projects/smartcard/sc7816.tar.gz

This tar file has the DES routines:
http://www.openssl.org/source/openssl-0.9.4.tar.gz

This tar file contains the Towitoko reader driver:
http://pcsc.virtualdave.com/~cprados/files/tow_chpdv-src-1.6.3.tar.gz

This tar file contains the Reflex 60 driver:
http://www.linuxnet.com/drivers/readers/files/slb_rf60-drv-current.tar.gz

Original Xcard and Cyberflex Xcard sources used to be found at
www.linuxnet.com but are not longer available.


		URL's


MUSCLE project (Xcard, PCSC-lite, Reflex 60, and all sorts of Smart
card related goodies):

	http://www.linuxnet.com/

Cyberflex web site:

	http://www.cyberflex.slb.com/

Towitoko driver and CT-API version of Xcard info:
http://pcsc.virtualdave.com/~cprados/

University of Michigan's CITI smartcard page:
http://www.citi.umich.edu/projects/smartcard/sc7816.html

OpenSSL info:
http://www.openssl.org/source/




	Building the sources

To build the sources, untar the files ("tar xzvf cyberflex2.1_tar.gz")
in a directory (recommended: /usr/local/src).  It will create files
./cyberflexlinux-2.1/...

You must install PCSC-Lite first.  You'll find a copy in this release.
Run "make" and "make install" (for the latter you must be root).
You'll also need to make and install the specific device drivers for
your card reader. (Schlumberger and Towitoko readers are enclosed in
the tar file.)

Then, "cd /usr/local/pcsc/bin" and run "pcscserver" (you must set
LD_LIBRARY_PATH=/usr/local/pcsc/lib).  (NOTE: You can get the latest
sources from http://www.linuxnet.com -- you must build the RPC version
(default) if you want to run the precompiled binaries.)

Please read each "README" file found in the src directories.
You must build all of them to run xcard.  (Only Towitoko and
Reflex 60 drivers are included.  You'll have to add your own
reader driver: see www.linuxnet.com for the complete list.)

Example cardlet is found in ./cyberflexlinux-2.1/example


	Pre-built files and how to use them:

First, cd to ".../src/pcsc-lite-0.5.5" and type "make install" (you
must be "root" to do this and this must be the first time you've
installed pcsc-lite -- otherwise you'll have to install or reconfigure
pcsc-lite-0.5.5/etc/reader.conf appropriately).  Note that you'll have
to edit reader.conf anyway, if you have untar'ed in different path
from "/usr/local/src".

Then, "cd /usr/local/pcsc/bin" and run "pcscserver" (you must set
LD_LIBRARY_PATH=/usr/local/pcsc/lib).  (NOTE: You can get the latest
sources from http://www.linuxnet.com -- you must build the RPC version
(default) if you want to run the precompiled binaries.)

In the ".../bin" directory, there are mksolo and xcard.  Make sure you
set PATH to /full-path/cyberflexlinux-2.1/bin and LD_LIBRARY_PATH to
/full-path/cyberflexlinux-2.1/lib. For example, if you untar'ed at:
/usr/local/src and use bash:

PATH=$PATH:/usr/local/src/cyberflexlinux-2.1/bin
LD_LIBRARY_PATH=/usr/local/src/cyberflexlinux-2.1/lib
export PATH LD_LIBRARY_PATH

(you might put this in your ~/.bash_profile)

To run mksolo, you can type in:

	> cd cyberflexlinux-2.1/example
	> mksolo -usemap=../lib/access/Access.map

For more details, please read the example/README file.



		Running Xcard

The only thing required to configure before running xcard is to create
a ".xcardrc" file in your home directory ($HOME).  (You can find
an example file in the ./cyberflexlinux-2.1/ directory.) This will let you
define your favorite reader at start up time.  The format should
be the same as PCSC reader.conf file:

FRIENDLYNAME	"Schlumberger Reflex 62"

(Otherwise, xcard will bring up the first reader name in reader.conf as
the initial reader.)

Get in the cyberflexlinux-2.1/bin directory to bring up xcard (you must run this in bin directory or in
src/xcard-pcsc-1.0 directory), and click on the coffee cup.  For the
dialog box, you want to enter:

	* Press [Verify Key] and in the dialog box, click [Verify] button
	* Select cardlet.  You can try example/Wallet.bin
	* Leave "Signing" key alone (if you have non-crypto card, blank it)
	* AID should be 5-16 bytes of HEX values (or ASCII enclosed in "")
	* File ID: two bytes of HEX
	* Container ID: two bytes of HEX
	* Data Size: two bytes of HEX
	* And then press [create cardlet]

To interact with the Wallet cardlet, "select cardlet" via the Java menu
and then bring the APDU manager and enter the following lines,
pressing "Send APDU" for each line:

                  IO   CLA INS P1  P2  P3  Data
Validate Pin:     send 03  40  00  00  04  00000000
Get Balance:      recv 03  30  00  00  01 (get one byte back: 20)

To delete the cardlet (and its instance) "delete cardlet" in Java menu
will do the trick.  You might have to verify key before you delete it.




--------
Version History of cyberflexlinux starter's kit
Date        Ver   Name           Comments
02-Nov-1998 1.0   Danny Kumamoto first release of Open16k version of xcard
04-Nov-1998 1.1   Danny Kumamoto first stable release of the kit
15-Jan-1999 1.2   Danny Kumamoto put in a bug fix for cardlet downloading
24-Feb-2000 2.0   Danny Kumamoto released to beta testers with CT-API version
                                 of xcard merged with Cyberflex support
                                 and added Access support
25-Feb-2000 2.0.9 Danny Kumamoto put in Dave Corcoran's PCSC suport for xcard
29-Feb-2000 2.1   Danny Kumamoto First stable release of xcard-pcsc
