A java application reads data from a card reader

If someone wants to write a Java application that interacts with a physical device, in particular with a reader (for example, when you go to a hotel, gym, bank, etc., and you transfer the card through a reader, and the application finds you in database) how is this done?
Is there a java api for interacting with the reader and receiving data about maps?
When a company creates a reader (physical device), does it provide the corresponding apis?
Are physical details abstracted from the application programmer?
I need to interact with the reader in java, but I do not know how to start.
Any input is welcome!

thanks

+4
source share
3 answers

You can start playing with javax.smartcardio .

This is an official Oracle product that allows you to interact with smart cards. This does not solve the problem of general communication with the device (on Unix, just open /dev/whatever0 with permissions, because it was a file), but it can help you in the script of your smart card.

+4
source

It depends on the platform. For example, ORACLE installs the Java Communications 3.0 API to work with:

The Java Communication API (also known as javax.comm) provides applications with access to RS-232 hardware (serial ports) and limited access to IEEE-1284 (parallel ports), SPP mode.

This may give you a starter.

+3
source

Here you have common usb drivers for smart card readers, as well as a daemon that can detect when new readers are connected, and some diagnostic data when the readers initiate a connection to the smart card (either via contact or contactless / NFC). http://www.linuxnet.com/

jpcsc can then be used as a java API for a map, so you can read and write. You are distracted from the reader's hardware, but you still need to learn a lot about the specifics of a smart card - in which version of Javacard / GlobalPlatform it uses, which crypto keys are used if you want to establish a secure connection, etc.

Or you can purchase a complete development environment, including a map, reader, and IDE (usually based on Eclipse) from a manufacturer of smart cards such as G and D, Oberthur, Gemalto ...

0
source

Source: https://habr.com/ru/post/1335678/


All Articles