The Android Smart Card Emulator allows the emulation of a contact-less smart card. The emulator uses Android’s HCE to fetch APDUs from a contact-less reader. The app allows to process the Command APDUs either by delegating them to a remote virtual smart card or by a built-in Java Card simulator. The response APDUs are then returned to the smart card reader.
With the built-in Java Card runtime of jCardSim [1] the app includes the following Applets:
F000000001)D2760001240102000000000000010000)A000000527210101)F276A288BCFBA69D34F31001)A000000397425446590201)The remote interface can be used together with the Virtual Smart Card, which allows emulating the following cards:
The remote interface can also be used together with the PC/SC Relay, which allows emulating a contactless card from an existing contact-based card (by relaying the commands from PC/SC to the phone).
You may also attach your own simulation to the remote interface by implementing a simple interface through a socket communication.
![\input{%(wd)s/bilder/tikzstyles.tex}
\node (reader) {\includegraphics[width=3cm]{%(wd)s/bilder/my_cardreader.pdf}};
\node [below=0cm of reader, kleiner] {Contact-less Reader};
\node (phone) [right=1cm of reader] {\includegraphics[width=3cm]{%(wd)s/bilder/smartphone.pdf}};
\node (app) [at=(phone.center)] {\includegraphics[width=2.8cm, height=4.9cm]{%(wd)s/bilder/ACardEmulator.png}};
\begin{pgfonlayer}{background}
\draw [rfid] (reader.center) -- (phone.west) ;
\end{pgfonlayer}](../_images/tikz-069feb98fbb6c2bcacad0fa341edc5ceaba0a732.png)
Simulate a contact-less Java Card with Android Smart Card Emulator
![\input{%(wd)s/bilder/tikzstyles.tex}
\node (reader) {\includegraphics[width=3cm]{%(wd)s/bilder/my_cardreader.pdf}};
\node [below=0cm of reader, kleiner] {Contact-less Reader};
\node (phone) [right=1cm of reader] {\includegraphics[width=3cm]{%(wd)s/bilder/smartphone.pdf}};
\node (app) [at=(phone.center)] {\includegraphics[width=2.8cm, height=4.9cm]{%(wd)s/bilder/ACardEmulator.png}};
\node (vicc) [aktivbox, right=2cm of phone, kleiner] {\texttt{vicc --reversed}};
\begin{pgfonlayer}{background}
\draw [rfid] (reader.center) -- (phone.west) ;
\path[linie] (phone) edge node {\includegraphics[width=1.5cm]{%(wd)s/bilder/simplecloud.pdf}} (vicc) ;
\end{pgfonlayer}](../_images/tikz-ad80edcb712885aba11512084ac22ff832c4ebbb.png)
Simulate a contact-less smart card with a remote virtual smart card
![\input{%(wd)s/bilder/tikzstyles.tex}
\node (reader) {\includegraphics[width=3cm]{%(wd)s/bilder/my_cardreader.pdf}};
\node [below=0cm of reader, kleiner] {Contact-less Reader};
\node (phone) [right=1cm of reader] {\includegraphics[width=3cm]{%(wd)s/bilder/smartphone.pdf}};
\node (app) [at=(phone.center)] {\includegraphics[width=2.8cm, height=4.9cm]{%(wd)s/bilder/ACardEmulator.png}};
\node (pcsc-relay) [aktivbox, right=2cm of phone, kleiner] {\texttt{pcsc-relay --emulator=vpcd}};
\node (card) [below=.5cm of pcsc-relay)] {\includegraphics[width=0.8cm]{%(wd)s/bilder/smartcard.pdf}};
\node (reader2) [below=1cm of pcsc-relay] {\includegraphics[width=1.3cm]{%(wd)s/bilder/my_cardreader.pdf}};
\begin{pgfonlayer}{background}
\draw [rfid] (reader.center) -- (phone.west) ;
\path[linie] (phone) edge node {\includegraphics[width=1.5cm]{%(wd)s/bilder/simplecloud.pdf}} (pcsc-relay) ;
\path[linie] (pcsc-relay) edge (reader2) ;
\end{pgfonlayer}](../_images/tikz-2623a4f0b37e685e9d3fa97479f3e06798f21da2.png)
Relaying a contact-based smart card with pcsc-relay
The Android Smart Card Emulator has the following dependencies:
Please note that the currently emulated applets are verifying the PIN by transmitting it without any protection between card and terminal. You may want to have a look at Erik Nellesson’s Virtual Keycard [7], which uses the PACE protocol for PIN verification.
The Android Smart Card Emulator is available on F-Droid [8].
To manually compile the app you need to fetch the sources and initialize the submodules:
git clone https://github.com/frankmorgner/vsmartcard.git
cd vsmartcard
# fetch the applets that are in the submodules
git submodule init
git submodule update
We use Android Studio [9] to build and deploy the application. Use
to select vsmartcard/ACardEmulator.
Attach your smartphone and choose .
Do you have questions, suggestions or contributions? Feedback of any kind is more than welcome! Please use our project trackers.
| [1] | http://www.jcardsim.org/ |
| [2] | https://github.com/licel/jcardsim/blob/master/src/main/java/com/licel/jcardsim/samples/HelloWorldApplet.java |
| [3] | https://developers.yubico.com/ykneo-openpgp/ |
| [4] | https://developers.yubico.com/ykneo-oath/ |
| [5] | http://www.pwendland.net/IsoApplet/ |
| [6] | https://github.com/vletoux/GidsApplet |
| [7] | https://github.com/eriknellessen/Virtual-Keycard |
| [8] | https://f-droid.org/repository/browse/?fdid=com.vsmartcard.remotesmartcardreader.app |
| [9] | http://developer.android.com/sdk/installing/studio.html |