>From what I understand the CT-API is mainly just useful for opening
communications with either the reader or the card.  I have seen some
concern about how to do reset, find status etc.  For example on the
Reflex 62 the following will perform a Reset:

unsigned char dad=1;       /* Reader */
unsigned char sad=2;       /* Host */
unsigned char cmd = 0x65;  /* Reset */
unsigned char lr = 0;      /* Reader will determine this */
unsigned char rsp[258];

CT_data(1,&dad,&sad,1,&cmd,&lr,rsp);

This just performed a Reset on a Reflex 62/64 and returned the ATR in rsp.
The higher level API which is used by the resource manager will call
functions like the one above and define functions like Reset, Status, etc.
Why is this useful ?  It makes it REALLY easy to work with the resource
manager because I don't have to worry about comm parameters, checksums,
and formatting commands for the reader/card.  Reader commands go out as
cmd and data received comes in as rsp with a trailing 2 status bytes such
as 90,0.  You will notice on the CT-API that I wrote for the Reflex 62/72,
all card commands the lr is done automatically  even on most reader
commands.  On proprietary commands such as GetRdrType and SecurePINentry
you can then specify how much data you want to receive.  If you do not, it
will just be flushed.

Thanks

Dave

*************************************************************
David Corcoran                 Internet Security/Smartcards

Work:                          Home:
Schlumberger Limited           2252 US Highway 52 West
205 Industrial Blvd            West Lafayette, IN 47906
Sugar Land, TX 77478
(281) 240-7054                 (765) 463-2455

http://www.cs.purdue.edu/homes/corcordt
http://www.linuxnet.com

Quote: If it doesn't work, at least make it look good.
       - Bill Gates
*************************************************************

***************************************************************
Linux Smart Card Developers - M.U.S.C.L.E.
(Movement for the Use of Smart Cards in a Linux Environment)
http://www.linuxnet.com/smartcard/index.html
***************************************************************

Reply via email to