How should I detect if I've got a reader/smartcard combo?

Grant Olson kgo at grant-olson.net
Tue Jan 18 06:29:10 CET 2011


I've got a working patch on my machine that lets me unplug my
reader/smartcard combo at will.  But it still needs some cleanup on a
few things before I can send it to the list.  There's one thing in
particular I'd appreciate some advice on.

Right now I detect when the device is removed by catching a change in
the slot status.  When the slot status equals zero it looks like this
means the card has been removed.  At that point I unload the reader.

This is working fine for me, but I imagine its less than ideal for a
stand-alone reader.  I imagine we want to keep scdaemon attached to the
reader.

If it was just a cryptostick issue, I could just check the vendor id.
But I believe OmniKey and SCM both have similar devices.  Can I query
through an existing scdaemon function to see if there's a reader
attached?  Or look to see if a particular device exists?  Or should I be
doing something else completely?  Are there approaches that will work
better with Windows boxes?  Etc...

I actually did order a reader and stand-alone card last week after
killing scdaemon one too many times, so I should be able to test both
configurations once those show up.

Any and all input is appreciated.

-Grant

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 565 bytes
Desc: OpenPGP digital signature
URL: </pipermail/attachments/20110118/d306e355/attachment.pgp>


More information about the Gnupg-devel mailing list