[Muscle] ifd-handler implementations without USB?

Ludovic Rousseau ludovic.rousseau at gmail.com
Sun Jul 1 04:16:56 PDT 2007


On 01/07/07, Geoff Elgey <Geoff.Elgey at quest.com> wrote:
> G'day,

Hello,

>  I wanted to test some PKCS#11 libraries that talk to a Common Access Card
> (CAC) via PC/SC.
>
>  So I wrote my own implementation of the PC/SC interface, whose basic
> function was to emulate the CAC APDU handling in the SCardTransmit()
> function. So the APDUs that would normally be routed by PC/SC to the card
> are now handled in software instead.
>
>  This seems to work fine, but the PKCS#11 libraries in question expect to
> load libpcsclite.so.1, and I had to perform some load-library path trickery
> to get my libpcsclite.so.1 implementation to load instead of the
> system-installed libpcsclite.so.1
>
>  But I am wondering if I can achieve the same thing (a CAC emulator) by
> writing an ifd-handler for pcsclite (like the ccid and e-gate handlers),
> rather than writing my own PC/SC implementation. This way, the PKCS#11
> libraries can still load the libpcsclite.so.1 that they expect to load, but
> I would be configuring pcsclite to use the cac-emulator ifd-handler instead
> of the ccid ifd-handler.
>
>  Is this possible? I had a brief look at the ifd-handler API and it there's
> discussion about USB devices. Is the ifd-handler API (and the pcsclite code
> that calls it) just meant for USB devices? Or is it sufficiently high-level
> enough that I can write a ifd-handler that represents a reader and card
> implemented purely in software?

I think the easiest way would be to emulate a serial smart card
reader. The main difference is that pcscd will load the driver during
start up and will not use a polling mechanism like for USB devices.

The ifdhandler API is described in [1]. And the serial reader
configuration is at [2].
It should be easy to simulate a card insertion/removal in the
IFDHICCPresence() function.

You can start with the PC/SC Driver Developers Kit from [3].

bye,

[1] http://pcsclite.alioth.debian.org/ifdhandler-3/
[2] http://pcsclite.alioth.debian.org/ifdhandler-3/node8.html
[3] http://musclecard.com/sourcedrivers.html

-- 
  Dr. Ludovic Rousseau


More information about the Muscle mailing list