Question

I am writing an application to interact with smart card currently using Java. I have a OMRON V2BF series card reader. The application is run on Debian.

I have tried using Java Smart Card I/O API to try to establish connection to the smart card.

But I couldn't detect/get any card terminals using

    TerminalFactory factory = TerminalFactory.getDefault();
    List<CardTerminal> terminals = factory.terminals().list();

I also tried using "Press and activate(cold reset) ICC" by sending a command packet to OMRON reader, but the response is always "Negative".

May I know which part I did wrongly? Any advice would be greatly appreciated!

Était-ce utile?

La solution

factory.terminals().list() will only show you PCSC compatible devices by default. I don't see any information on PCSC support for the current reader. Please consult the documentation or the supplier for that.

Your smart card should be a ISO 7816-4 compatible smart card to work with javax.smartcardio, memory cards won't work. javax.smartcardio is basically for use with CommandAPDU and ResponseAPDU, which are ISO 7816-4 compatible data structures for "processor" cards.

You may be stuck with communicating with the reader through the serial interface using the interface specification delivered by the reader manufacturer. You can use the Java Communications API to do that.

Note that many manufacturers will supply sample code and libs in C/C++ or even .NET, in that case it may be an option to switch programming language/platform or create a JNI wrapper around the native code.

If you are writing for a processor card (e.g. credit card) you may even create a javax.smartcardio compatible Terminal yourself and insert it into the terminal list.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top