[Pcsclite-muscle] Asynchronous PCSC API

Ievgenii Meshcheriakov ievgenii.meshcheriakov at qt.io
Fri Jan 21 06:17:49 PST 2022


I'm trying to add PCSC support to Qt using pcsclite, but having problems  
doing this in a manner that is compatible with Qt's event system.

There are some parts of API that are either blocking or require polling 
(SCardGetStatusChange(), SCardConnect() when another app is holding a 
transaction, probably others too). This necessitates using multiple threads to 
ensure that user's application is not blocked by the PCSCLite API calls (1 to 
detect slots, and probably 1 per slot). I know about SCardCancel(), but that 
requires coordination of shared access to context handles, and working around 
possible race conditions.

I guess I'm stuck with this API for Windows, but I was wondering whether it is 
possible to use some better API on Linux. Is there an exisiting asyncronous 
API for pcscd or maybe there are plans to implement it? Maybe something 
similar to CryptoTokenKit, but perhaps with better control over lifetime of 
various objects?


More information about the pcsclite-muscle mailing list