[Pcsclite-muscle] Asynchronous PCSC API

Ludovic Rousseau ludovic.rousseau at gmail.com
Fri Jan 21 06:31:50 PST 2022


Le ven. 21 janv. 2022 à 15:19, Ievgenii Meshcheriakov
<ievgenii.meshcheriakov at qt.io> a écrit :
>
> Hi,

Hello Ievgenii,

> 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?

The WinSCard API has been defined by the PC/SC workgroup
https://pcscworkgroup.com/ 20 years ago.
No asynchronous API is planned AFAIK.

I am afraid you will have to use threads or something similar in your case.
But maybe someone else has a better idea?

Bye

-- 
 Dr. Ludovic Rousseau



More information about the pcsclite-muscle mailing list