locked
How to use the USB CCID smartcard driver from Store App?

    Question

  • How can I use the "Microsoft Class Drivers for USB CCID Smart Cards" to control a CCID smartcard reader from a Store app?

    Somebody in Microsoft must have tested this driver, hopefully from a Store App, and knows how to use it.  On the desktop side, PC/SC uses it, but that API is not available in Store apps.

    Would an approach through "Windows.Devices.Usb" or "Windows.Devices.Custom" make sense?

    I looked at:  "Talking to USB devices, start to finish (Windows Store app)"
    http://msdn.microsoft.com/en-us/library/windows/hardware/dn312121(v=vs.85).aspx

    but step 3 says "You can write a Windows Store app, if device class, subclass, and protocol code of the device is one of the following:"
    •name:cdcControl, classId:02 * *
    •name:physical, classId:05 * *
    •name:personalHealthcare, classId:0f 00 00
    •name:activeSync, classId:ef 01 01
    •name:palmSync, classId:ef 01 02
    •name:deviceFirmwareUpdate, classId:fe 01 01
    •name:irda, classId:fe 02 00
    •name:measurement, classId:fe 03 *
    •name:vendorSpecific, classId:ff * *


    But Using Device Manager gives me:
    Class   SmartCardReader
    Class GUID  {50dd5230-ba8a-11d1-bf5d-0000f805f530}
    Device description: SCR35xx USB Smart Card Reader

    Thanks in advance for any of your experiences or help.

    Saturday, March 01, 2014 6:17 PM

All replies

  • Hi Andrew - I moved your question over to our hardware forum since we have people who are far more experienced in driver issues on that forum. Please let me know if you have any questions about this.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, March 03, 2014 1:14 PM
    Moderator
  • Hi Andrew

    In the meantime while we try to get a hardware specialist to look at this with you, this page may be useful as it detailed the class IDs etc for USB CCID Smart Cards:

    http://msdn.microsoft.com/library/windows/hardware/gg487509.aspx#EYC

    If I look at my own Smart Card reader in device manager it shows the same class and class GUID as you. If I look at the Compatible IDs property of the device on the details tab of the device properties it shows the class as 0B which appears to be the same as on that page I reference above. That class does not match any of the allowed classes. 

    So it is looking like the answer is you cannot but we will see if we can get you a definitive answer and/or more information.

    Regards

    Doug

    Tuesday, March 04, 2014 9:48 AM
  • Andrew,

    I am looking into this for you.  I do not see an obvious way to do this.

    Best Regards - Eric


    This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, March 07, 2014 4:36 AM
    Moderator
  • Thank you.  I would think the developers of Windows.Devices.SmartCards would know if they intended to prevent smartcard development at the command level in Store apps, whether it was an accident, or if there is a way through the CCID driver.  ACS's Android library can do it.
    Friday, March 07, 2014 5:23 AM
  • Andrew,

    As you noted the Windows.Devices.Usb namespace does not support store apps talking to USB CCID Smart Cards.  Certain classes like CCID are not accessible with the USB API to avoid interfering with built-in OS functionality.  

    Also as you noted the list of allowed USB device classes, subclasses and protocols is listed below excerpted from (MSDN) Talking to USB devices, start to finish (Windows Store app) are:

    You can write a Windows Store app, if device class, subclass, and protocol code of the device is one of the following:
    •name:cdcControl,      classId:02 * *
    •name:physical,      classId:05 * *
    •name:personalHealthcare,      classId:0f 00 00
    •name:activeSync,      classId:ef 01 01
    •name:palmSync,      classId:ef 01 02
    •name:deviceFirmwareUpdate,      classId:fe 01 01
    •name:irda,      classId:fe 02 00
    •name:measurement,      classId:fe 03 *

    name:vendorSpecific, classId:ff * *

    What is the specific tasks you would like to accomplish?

    Best Regards - Eric


    This posting is provided "AS IS" with no warranties, and confers no rights.

    Monday, March 10, 2014 5:15 PM
    Moderator
  • Hi. Have you looked at this //Build 2013 session on authentication including SmartCards?

    http://channel9.msdn.com/Events/Build/2013/2-041

    Maybe it will help. Maybe it won't. Hope it does though.

    Christine

    Monday, March 10, 2014 10:28 PM
  • >>What is the specific tasks you would like to accomplish?  Best Regards - Eric

    Simply send my own commands to a smartcard.  I can do it fine with PC/SC using the Win32 environment, but not with the Store Apps environment.  The CCID approach is just a means to that end.

    >> Have you looked at this //Build 2013 session Christine

    Yes, I did in 2013 and asked the question "Please address how to send an APDU to a real smart card in a reader similar to the API SCardTransmit()."  The answer was:

    Himanshu Soni

    bdhc73a - I assume you are asking if there is an ability to send APDU to a smart card (real or virtual) using WinRT API from a Windows Store App. For Windows 8.1, this functionality is not available. Only Win32 applications can send APDUs to real or virtual smart cards.

    So I tried to see if there was a way via a driver approach, if not through a WinRT API.

    Monday, March 10, 2014 11:57 PM
  • Andrew,

    What sort of commands? Just raw APDU back and forth?  Also would you use one command per transaction or more?

    Best Regards - Eric


    This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, March 19, 2014 9:12 PM
    Moderator
  • Here are my answers:

    >> What sort of commands?

    The most common would be those defined in ISO 7816-4, NIST 800-73, and Global Platform.  I also use company proprietary commands, and the list of commands grows as the standards evolve.    I already have the code to generate the commands I need, but no way to sent them in Store apps.

    Another use case example might be someone looking to implement a EMV point of sale device with a Store App that needs to communicate with a EMV smartcard. 

    >> Just raw APDU back and forth? 

    That is correct.  Since I use the Global Platform secure messaging with keys in HSMs, an API that restricted you to some common commands just would not cover the use case. 

    >> Also would you use one command per transaction or more?

    Typically there would a group of APDUs that make up one transaction.

    Thursday, March 20, 2014 3:31 AM
  • Andrew,

    This is not possible from a Windows Store App.  It would be possible from a desktop application of course.

    Best Regards - Eric


    This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, April 09, 2014 10:42 PM
    Moderator
  • Andrew,

    We do have some support in Windows Phone 8.1 .   I would be curious if these APIs would allow you to do what you need to do.

    http://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.smartcards.aspx

    Best Regards - Eric


    This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, April 22, 2014 9:47 PM
    Moderator
  • The SmartCardConnection.TransmitAsync method looks very promising.  I'll investigate.

    Tuesday, April 22, 2014 10:05 PM