LudovicRousseau / pyscard

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

How to know the interface type #139

Closed antonio-fr closed 1 year ago

antonio-fr commented 1 year ago

I spent some time to build a detection method to know whether the card connection is through contactless or with contacts. And so far, I didn't find any reliable method to get this information. This is needed as some cards behave differently depending of the access interface, mostly because internally the applet knows which interface is currently used, and can act accordingly. Also some standards like EMV instruct to behave differently depending of the access interface. All that makes the need for knowing the access interface when talking to a smartcard.

My idea is to have in the card object a _iscontactless attribute which is true when the connection is done through the wireless interface. How can it be done ?

On Windows ? On Mac ? On Linux?

LudovicRousseau commented 1 year ago

I do not know a reliable way to know if the card is contact or contactless using PC/SC. If the card can tell you the communication mode that should work fine. It is up to you to define it.

Ask you question on the mailing list to get a broader audience. See https://ludovicrousseau.blogspot.com/2020/11/how-to-get-smart-card-support.html