Important!

Blog moved to https://blog.apdu.fr/

I moved my blog from https://ludovicrousseau.blogspot.com/ to https://blog.apdu.fr/ . Why? I wanted to move away from Blogger (owne...

Thursday, April 8, 2010

PC/SC sample in different languages

The PC/SC API also called WinSCard can be used from a large variety of languages. I will start a serie of blogs to present the same program (functionnally) but using different languages.

Languages:

  1. C
  2. Perl
  3. Python
  4. scriptor
  5. OCaml
  6. Prolog
  7. Ruby
  8. Java
  9. C#
  10. Ada
  11. PHP (dead upstream as 11 January 2015)
  12. PHP5
  13. lua
  14. JavaScript (Node.js)
  15. Python (using python-pcsclite)
  16. Common Lisp
  17. C for UEFI
  18. Objective-C (using Crypto Token Kit)
  19. Swift (using Crypto Token Kit)
  20. go
  21. Smart Card Connector on Chromebook
  22. Rust
  23. Objective-C (synchronous)
  24. Java using intarsys smartcard-io
  25. Kotlin
  26. Scala  
  27. Free Pascal (Lazarus)
  28. Flutter/Dart
  29. Elixir
  30. Erlang
  31. TypeScript (Deno) 
If you know a wrapper for a language not listed above please contact me.

Program

The program shall do:
  1. connect to the first found smart card reader
  2. send APDU: 00 A4 04 00 0A A0 00 00 00 62 03 01 0C 06 01
  3. display result
  4. send APDU: 00 00 00 00
  5. display result
The first APDU is a SELECT command to select a test applet. The second command is the only command known by the applet.


Smart card Applet

The applet only knows one command and returns Hello world! (yes, it is a test applet). It was described in a French magazine GNU/Linux Magazine HS n°39.