LudovicRousseau / pyscard

pyscard smartcard library for python
http://pyscard.sourceforge.net/
GNU Lesser General Public License v2.1
383 stars 110 forks source link

Cannot send command to reader #51

Closed andgineer closed 6 years ago

andgineer commented 6 years ago

For example Get firmware version as described on https://www.acs.com.hk/en/products/159/acr1281u-c1-dualboost-ii-usb-dual-interface-reader/

There should be separate way to send command not to card but to reader (pc to RDR escape as in ACR documentation). This is APDU commands so I cannot use doCommand that send one code.

In fact I am looking for a way to communicate with SAM (secure access module) installed on the reader. I can communicate with card in proximity with the reader but see no way to execute reader commands specifically to select SAM.

LudovicRousseau commented 6 years ago

Have a look at this code https://anonscm.debian.org/cgit/pcsclite/PCSC.git/tree/UnitaryTests/FEATURE_CCID_ESC_COMMAND_Xiring.py

andgineer commented 6 years ago

Thank you!

andgineer commented 6 years ago

Is that possible to connect to the SAM interface in the smartcard library? In ACR documentation this is described as SCardConnect(... 'ACR128U SAM Interface'...)

Ok I figured it out https://stackoverflow.com/questions/46948881/how-to-send-pcsc-commands-to-sam-and-not-to-card-on-reader/46975560#46975560

LudovicRousseau commented 6 years ago

Yes, it is.

andgineer commented 6 years ago

How to do that? I do not understand how to pass interface name