>From my blog http://ludovicrousseau.blogspot.com/
PCSC sample in 
scriptor<http://ludovicrousseau.blogspot.com/2010/05/pcsc-sample-in-scriptor.html>
 Installation
scriptor and gscriptor are tools included in the pcsc-tools package (
http://ludovic.rousseau.free.fr/softwares/pcsc-tools/index.html)

The licence is GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.

On a Debian system just do:

apt-get install pcsc-tools


Source code for scriptor
These 2 tools allows to send APDU to a card. They are very simple by yet
useful for some basic cases.

If used in interactive mode (use Ctrl-d to quit):

$ scriptor
No reader given: using Gemplus GemPC Twin 00 00
Using T=1 protocol
Reading commands from STDIN
00 A4 04 00 0A A0 00 00 00 62 03 01 0C 06 01
> 00 A4 04 00 0A A0 00 00 00 62 03 01 0C 06 01
< 90 00 : Normal processing.
00 00 00 00
> 00 00 00 00
< 48 65 6C 6C 6F 20 77 6F 72 6C 64 21 90 00 : Normal processing.

If used as a script file:

$ cat essai.scriptor
#! /usr/bin/env scriptor
reset
# Select applet
00 A4 04 00 0A A0 00 00 00 62 03 01 0C 06 01
# APDU de test
00 00 00 00

Empty lines or lines starting by # are comments and ignored. reset is a
keyword to reset the card and start with a known state.

Output
$ ./essai.scriptor
No reader given: using Gemplus GemPC Twin 00 00
Using T=1 protocol
Using given file: ./essai.scriptor
#! /usr/bin/env scriptor
reset
> RESET
< OK: 3B EA 00 00 81 31 20 43 80 65 A2 01 01 01 3D 72 D6 43 A5
# Select applet
00 A4 04 00 0A A0 00 00 00 62 03 01 0C 06 01
> 00 A4 04 00 0A A0 00 00 00 62 03 01 0C 06 01
< 90 00 : Normal processing.
# APDU de test
00 00 00 00
> 00 00 00 00
< 48 65 6C 6C 6F 20 77 6F 72 6C 64 21 90 00 : Normal processing.

Source code for gscriptor
The same script can be used by gscriptor. gscriptor is a graphical version
of scriptor.

Output


gscriptor can display the results in ASCII. This is useful in our case since
the test APDU just sends the string "Hello world!"



Conclusion
scriptor and gscriptor are easy to use for simple tasks. In general I use
them to check the smart card stack is working correctly.
_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle

Reply via email to