This is a tool to connect web pages to smart card via java script. This tool works with all ISO7816/14443 and NFC smart cards. smartcardPage is a demo page to demonstrate how to use smartcardBridge. You can send APDU command and receive APDU response to/from all ISO7816/14443 and NFC smart card with this utility. It also supports jCardSim as java card simulator with a simple REST server. You may use smartcardBridge to share smart card between different virtual machines (VM) and to share a smart card on a network.
You can see the online demo version of smartcardPage and smartcardBridge at: https://hosseinpro.github.io/smartcardPage/
You may download smartcardBridge setup file for Windows and MacOS here
smartcardBridgeClient.js which implements all required calls and catches. If you would like to use smartcardBridge at your own web page, you just need this library. Although, you may develop your own library and call smartcardBridge services directly.
getVersion: Connects to smartcardBridge and returns its version. You may use this function to check if smartcardBridge is installed.
listCardreaders: Returns a list of all smartcard readers which are connected to the client.
cardreaderConnect: Connects to a smartcard inserted in a smartcard reader.
cardreaderDisconnect: Disconnects from a smartcard.
cardreaderTransmit: Sends a smartcard command (APDU) to a smartcard and receives its response.
Compile and Run
smartcardPage is developed using ReactJS and Bootstrap 4. It also uses Axios as HTTP client library to call smartcardBridge HTTP services. Actually, smartcardBridge and smartcardPage are two separate independent projects which you may download each one and compile them independently.
To compile smartcardPage, you must install NPM or another package manager, and run these commands:
- Download smartcardPage's source code with:
git clone https://github.com/hosseinpro/smartcardPage
- Go to smartcardPage folder and install required node modules with:
npm install (or equivalent command in yarn or other package managers)
- Run development server to display smartcardPage:
Change of address
smartcardBridge serves at http://localhost:3333 by default. If you want to change that, you can update the service address for smartcardPage at /src/App.js in 'smartcardBridgeAddress' properties of MainPage component.