Search code examples
javaapache-flexusbnfcsmartcard-reader

Interacting with a usb smartcard reader/writer (NFC) from Flex


I would like to be able to use a usb SmartCard reader/writer (NFC) using Flex but I cannot find out how to do it.

I know this approach does not seem the most secure, but I know that, for example, you can use with Flex a usb webcam if the users accepts to give that permission to the web application.

To give you a little background info about why I would need this: We have developped a web application which would be deployed in a local network of an enterprise and which server-side part is developped in java and which client side is developped in Flex. I have managed to use the reader/writer from the java part but that obviously is not practical as we can only use the tag reader/writer attached to the physical server. What we need is to be able to give the client the possibility to use the reader/writer connected to his PC. If needed, I would have total access to the client machines (if I need to give the application any kind of special permissions).

Thanks in advance for any clue you could give me!


Solution

  • You can't do anything in native Air, which would be the runtime that would expose such an API. You can do a native system app (Windows or Mac) and that app leverages two processes that communicate with eachother.

    The main process would spawn two processes

    • Air client
    • Smart Card Reader writer

    So the main app would work as a HUB between the two.

    Maybe it's worth to look at a FlashPlayer app that runs in the browser and communicates with a Java Applet via ExternalInterface.