-
Notifications
You must be signed in to change notification settings - Fork 705
Smart Card Simulation
This guide uses jCardSim to simulate the following Open Source Java Card Applets:
The description can easily be adapted for other applets as well. We focus on Windows since this is the only platform with a virtual smart card reader supported by jCardSim.
-
Install virtual smart card reader: Either use the original source code and follow its manual or use the pre-built installer, BixVReaderInstaller.msi, from the Virtual Smart Card project.
-
Enable the Pipe Reader: Change
C:\Windows\BixVReader.ini
to something like this
[Driver]
NumReaders=1
[Reader0]
RPC_TYPE=0
VENDOR_NAME=Fabio Ottavi
VENDOR_IFD_TYPE=Pipe Reader
DECIVE_UNIT=0
- Reload the configuration: In the Device Manager, deactivate and activate the Bix Virtual Smart Card Reader to load the modification of
BixVReader.ini
. Alternatively, you can usedevcon.exe
from the Windows Driver Kit:
devcon.exe disable root\BixVirtualReader
devcon.exe enable root\BixVirtualReader
- Download and Install Java (
java.exe
andjavac.exe
are required) - Download jCardSim
Now, configure jCardSim to load and run the applet to make it available via PC/SC (see sections below).
- Download and build IsoApplet:
git clone https://github.com/philipWendland/IsoApplet
javac -classpath jcardsim-3.0.4-SNAPSHOT.jar IsoApplet\src\net\pwendland\javacard\pki\isoapplet\*.java
- Create
jcardsim_isoapplet.cfg
for IsoApplet:
com.licel.jcardsim.card.applet.0.AID=F276A288BCFBA69D34F31001
com.licel.jcardsim.card.applet.0.Class=net.pwendland.javacard.pki.isoapplet.IsoApplet
com.licel.jcardsim.card.ATR=3B80800101
- Run jCardSim with IsoApplet package:
javac -classpath jcardsim-3.0.4-SNAPSHOT.jar;IsoApplet\src com.licel.jcardsim.remote.BixVReaderCard jcardsim_isoapplet.cfg
- Create IsoApplet from the install package:
opensc-tool --card-driver default --send-apdu 80b800001a0cf276a288bcfba69d34f310010cf276a288bcfba69d34f3100100
- Download and build OpenPGP applet:
git clone https://github.com/Yubico/ykneo-openpgp
javac -classpath jcardsim-3.0.4-SNAPSHOT.jar ykneo-openpgp\applet\src\openpgpcard\*.java
- Create
jcardsim_openpgp.cfg
for OpenPGP applet:
com.licel.jcardsim.card.applet.0.AID=D2760001240102000000000000010000
com.licel.jcardsim.card.applet.0.Class=openpgpcard.OpenPGPApplet
com.licel.jcardsim.card.ATR=3B80800101
- Run jCardSim with OpenPGP:
javac -classpath jcardsim-3.0.4-SNAPSHOT.jar;ykneo-openpgp\applet\src com.licel.jcardsim.remote.BixVReaderCard jcardsim_openpgp.cfg
- Create OpenPGP applet from the install package:
opensc-tool --card-driver default --send-apdu 80b800002210D276000124010200000000000001000010D276000124010200000000000001000000
- Download and build PivApplet:
git clone https://github.com/arekinath/PivApplet
javac -classpath jcardsim-3.0.4-SNAPSHOT.jar PivApplet\src\net\cooperi\pivapplet\*.java
- Create
jcardsim_pvi.cfg
for OpenPGP applet:
com.licel.jcardsim.card.applet.0.AID=A000000308000010000100
com.licel.jcardsim.card.applet.0.Class=net.cooperi.pivapplet.PivApplet
com.licel.jcardsim.card.ATR=3B80800101
- Run jCardSim with PivApplet:
javac -classpath jcardsim-3.0.4-SNAPSHOT.jar;PivApplet\src com.licel.jcardsim.remote.BixVReaderCard jcardsim_pvi.cfg
- Create PIV applet from the install package:
opensc-tool --card-driver default --send-apdu 80B80000180BA0000003080000100001000BA00000030800001000010000
Warning: Due to attempts to plant malicious links to our wiki, it is no longer open to anyone to edit. If you want to contribute to this, wiki, please open a pull request here: https://github.com/OpenSC/Wiki.