I am building an enterprise browser based application, which works on a dedicated PC with a touch screen (think of it as a Kiosk, sort of). So, the application itself is built on NodeJS and the user makes choices on the browser and inserts their Smart Card. Since JavaScript can't directly read and decrypt the Smart Card data, a Java program running on this PC detects the inserted Smart Card and reads the data. Now, the problem is to send this Smart Card details (name, address etc..) to the JS code. I'm not really sure how to solve this, the following are a few ideas:
- The Java Smart Card reader, after reading the data, outputs it to as a keyboard input. The JS code then listens to this specific keyboard event and reads all the data. Kind of like how a bar-code scanner works.
- The Java Smart Card reader and the browser are connected to a cloud and have a WebSocket channel established. The Java program after reading the data, pushes it to the cloud server and the cloud server then pushes it to the Browser via WebSockets.
- Run the Java Smart Card reader as a web-server (localhost) with a self-signed SSL certificate. Add a local domain name to the server in the hosts file. Now, the browser can directly talk to the Java web-server through a Http API.
- Run the Java Smart Card reader with gRPC (localhost) and connect the browser to it via gRPC-web. (I have no experience in gRPC, but maybe this is possible?)
Each of the above have their own pitfalls. I'm not sure how other Kiosk based systems work, so any suggestions or improvements on the above ideas would be great.