1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349
|
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Android Smart Card Emulator — vsmartcard 2017-01-16 documentation</title>
<link rel="stylesheet" href="../_static/basic.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/bootswatch-3.3.4/flatly/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="../_static/bootstrap-sphinx.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '2017-01-16',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="../_static/js/jquery-fix.js"></script>
<script type="text/javascript" src="../_static/bootstrap-3.3.4/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../_static/bootstrap-sphinx.js"></script>
<link rel="shortcut icon" href="../_static/chip.ico"/>
<link rel="top" title="vsmartcard 2017-01-16 documentation" href="../index.html" />
<link rel="next" title="Tizen Smart Card Emulator" href="../TCardEmulator/README.html" />
<link rel="prev" title="Remote Smart Card Reader" href="../remote-reader/README.html" />
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">
</head>
<body>
<a href="https://github.com/frankmorgner/vsmartcard"
class="visible-desktop hidden-xs"><img
id="gh-banner"
style="position: absolute; top: 50px; right: 0; border: 0;"
src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png"
alt="Fork me on GitHub"></a>
<script>
// Adjust banner height.
$(function () {
var navHeight = $(".navbar .container").css("height");
$("#gh-banner").css("top", navHeight);
});
</script>
<div id="navbar" class="navbar navbar-default ">
<div class="container">
<div class="navbar-header">
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../index.html">
vsmartcard</a>
<span class="navbar-text navbar-version pull-left"><b></b></span>
</div>
<div class="collapse navbar-collapse nav-collapse">
<ul class="nav navbar-nav">
<li class="dropdown globaltoc-container">
<a role="button"
id="dLabelGlobalToc"
data-toggle="dropdown"
data-target="#"
href="../index.html">Site <b class="caret"></b></a>
<ul class="dropdown-menu globaltoc"
role="menu"
aria-labelledby="dLabelGlobalToc"><ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../virtualsmartcard/README.html">Virtual Smart Card</a></li>
<li class="toctree-l1"><a class="reference internal" href="../remote-reader/README.html">Remote Smart Card Reader</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="">Android Smart Card Emulator</a></li>
<li class="toctree-l1"><a class="reference internal" href="../TCardEmulator/README.html">Tizen Smart Card Emulator</a></li>
<li class="toctree-l1"><a class="reference internal" href="../pcsc-relay/README.html">PC/SC Relay</a></li>
<li class="toctree-l1"><a class="reference internal" href="../ccid/README.html">USB CCID Emulator</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../virtualsmartcard/api.html">Creating a Virtual Smart Card</a></li>
</ul>
</ul>
</li>
<li class="dropdown">
<a role="button"
id="dLabelLocalToc"
data-toggle="dropdown"
data-target="#"
href="#">Page <b class="caret"></b></a>
<ul class="dropdown-menu localtoc"
role="menu"
aria-labelledby="dLabelLocalToc"><ul>
<li><a class="reference internal" href="#">Android Smart Card Emulator</a><ul>
<li><a class="reference internal" href="#download-and-install">Download and Install</a></li>
<li><a class="reference internal" href="#question">Question</a></li>
<li><a class="reference internal" href="#notes-and-references">Notes and References</a></li>
</ul>
</li>
</ul>
</ul>
</li>
<li>
<a href="../remote-reader/README.html" title="Previous Chapter: Remote Smart Card Reader"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">« Remote Smart Car...</span>
</a>
</li>
<li>
<a href="../TCardEmulator/README.html" title="Next Chapter: Tizen Smart Card Emulator"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">Tizen Smart Card... »</span>
</a>
</li>
<li class="hidden-sm"></li>
</ul>
<form class="navbar-form navbar-right" action="../search.html" method="get">
<div class="form-group">
<input type="text" name="q" class="form-control" placeholder="Search" />
</div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-12 content">
<div class="section" id="android-smart-card-emulator">
<span id="acardemulator"></span><h1>Android Smart Card Emulator<a class="headerlink" href="#android-smart-card-emulator" title="Permalink to this headline">¶</a></h1>
<div class="sidebar">
<p class="first sidebar-title">Use an Android phone as contact-less smart card</p>
<table class="last docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">License:</th><td class="field-body">GPL version 3</td>
</tr>
<tr class="field-even field"><th class="field-name" colspan="2">Tested Platform:</th></tr>
<tr class="field-even field"><td> </td><td class="field-body">Android, CyanogenMod</td>
</tr>
</tbody>
</table>
</div>
<p>The Android Smart Card Emulator allows the emulation of a contact-less smart card.
The emulator uses Android’s <abbr title="host card emulation">HCE</abbr> 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. Together with
<a class="reference internal" href="../TCardEmulator/README.html#tcardemulator"><em>Tizen Smart Card Emulator</em></a> it is also possible to use a smartwatch as communication
device instead of the phone.</p>
<p>With the built-in Java Card runtime of <a class="reference external" href="http://www.jcardsim.org/">jCardSim</a> <a class="footnote-reference" href="#id1" id="id2">[1]</a> the app includes the following
Applets:</p>
<ul class="simple">
<li><a class="reference external" href="https://github.com/licel/jcardsim/blob/master/src/main/java/com/licel/jcardsim/samples/HelloWorldApplet.java">Hello World Applet</a> <a class="footnote-reference" href="#id3" id="id4">[2]</a> (application identifier <tt class="docutils literal"><span class="pre">F000000001</span></tt>)</li>
<li><a class="reference external" href="https://developers.yubico.com/ykneo-openpgp/">OpenPGP Applet</a> <a class="footnote-reference" href="#id5" id="id6">[3]</a> (application identifier <tt class="docutils literal"><span class="pre">D2760001240102000000000000010000</span></tt>)</li>
<li><a class="reference external" href="https://developers.yubico.com/ykneo-oath/">OATH Applet</a> <a class="footnote-reference" href="#id7" id="id8">[4]</a> (application identifier <tt class="docutils literal"><span class="pre">A000000527210101</span></tt>)</li>
<li><a class="reference external" href="http://www.pwendland.net/IsoApplet/">ISO Applet</a> <a class="footnote-reference" href="#id9" id="id10">[5]</a> (application identifier <tt class="docutils literal"><span class="pre">F276A288BCFBA69D34F31001</span></tt>)</li>
<li><a class="reference external" href="https://github.com/vletoux/GidsApplet">GIDS Applet</a> <a class="footnote-reference" href="#id11" id="id12">[6]</a> (application identifier <tt class="docutils literal"><span class="pre">A000000397425446590201</span></tt>)</li>
</ul>
<p>The remote interface can be used together with the <a class="reference internal" href="../virtualsmartcard/README.html#vicc"><em>Virtual Smart Card</em></a>, which allows
emulating the following cards:</p>
<ul class="simple">
<li>Generic ISO-7816 smart card</li>
<li>German electronic identity card (nPA)</li>
<li>Electronic passport</li>
</ul>
<p>The remote interface can also be used together with the <a class="reference internal" href="../pcsc-relay/README.html#pcsc-relay"><em>PC/SC Relay</em></a>,
which allows emulating a contactless card from an existing contact-based card
(by relaying the commands from PC/SC to the phone).</p>
<p>You may also attach your own simulation to the remote interface by implementing
a simple interface through a socket communication.</p>
<div class="figure">
<p><img src="../_images/tikz-f7010fa8209b3752026a52619d57bbebb8fa2bcd.svg" alt="\input{$wd/bilder/tikzstyles.tex}
\node (reader) {\includegraphics[width=3cm]{$wd/bilder/my_cardreader.pdf}};
\node [below=0cm of reader, kleiner] {Contact-less Reader};
\node (phone) [right=1cm of reader] {\includegraphics[width=3cm]{$wd/bilder/smartphone.pdf}};
\node (app) [at=(phone.center)] {\includegraphics[width=2.8cm, height=4.9cm]{$wd/bilder/ACardEmulator.png}};
\begin{pgfonlayer}{background}
\draw [rfid] (reader.center) -- (phone.west) ;
\end{pgfonlayer}" /></p>
<p class="caption">Simulate a contact-less Java Card with Android Smart Card Emulator</p></div><div class="figure">
<p><img src="../_images/tikz-ae1e764f23cec8b5d67952bc6d8bbe66280e80d1.svg" alt="\input{$wd/bilder/tikzstyles.tex}
\node (reader) {\includegraphics[width=3cm]{$wd/bilder/my_cardreader.pdf}};
\node [below=0cm of reader, kleiner] {Contact-less Reader};
\node (phone) [right=1cm of reader] {\includegraphics[width=3cm]{$wd/bilder/smartphone.pdf}};
\node (app) [at=(phone.center)] {\includegraphics[width=2.8cm, height=4.9cm]{$wd/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/bilder/simplecloud.pdf}} (vicc) ;
\end{pgfonlayer}" /></p>
<p class="caption">Simulate a contact-less smart card with a remote virtual smart card</p></div><div class="figure">
<p><img src="../_images/tikz-30c9c7049675e5b06e8364c63b0718d51986e380.svg" alt="\input{$wd/bilder/tikzstyles.tex}
\node (reader) {\includegraphics[width=3cm]{$wd/bilder/my_cardreader.pdf}};
\node [below=0cm of reader, kleiner] {Contact-less Reader};
\node (phone) [right=1cm of reader] {\includegraphics[width=3cm]{$wd/bilder/smartphone.pdf}};
\node (app) [at=(phone.center)] {\includegraphics[width=2.8cm, height=4.9cm]{$wd/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/bilder/smartcard.pdf}};
\node (reader2) [below=1cm of pcsc-relay] {\includegraphics[width=1.3cm]{$wd/bilder/my_cardreader.pdf}};
\begin{pgfonlayer}{background}
\draw [rfid] (reader.center) -- (phone.west) ;
\path[linie] (phone) edge node {\includegraphics[width=1.5cm]{$wd/bilder/simplecloud.pdf}} (pcsc-relay) ;
\path[linie] (pcsc-relay) edge (reader2) ;
\end{pgfonlayer}" /></p>
<p class="caption">Relaying a contact-based smart card with pcsc-relay</p></div><p>The Android Smart Card Emulator has the following dependencies:</p>
<ul class="simple">
<li>NFC hardware built into the smartphone for <abbr title="host card emulation">HCE</abbr></li>
<li>Android 4.4 “KitKat” (or newer) or CyanogenMod 11 (or newer)</li>
<li>permissions for a data connection (communication with Virtual Smart Card) and
for using NFC (communication to the reader); scanning the configuration via
QR code requires permission to access the camera</li>
<li>Virtual Smart Card <a class="reference internal" href="../virtualsmartcard/README.html#vicc-install"><em>installed on the host computer</em></a> for
using the remote interface</li>
</ul>
<p>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 <a class="reference external" href="http://sar.informatik.hu-berlin.de/research/publications/SAR-PR-2014-08/SAR-PR-2014-08_.pdf">Erik Nellesson’s</a>
<a class="reference external" href="https://github.com/eriknellessen/Virtual-Keycard">Virtual Keycard</a> <a class="footnote-reference" href="#id13" id="id14">[7]</a>, which uses the PACE protocol for PIN verification.</p>
<div class="section" id="download-and-install">
<span id="acardemulator-install"></span><h2>Download and Install<a class="headerlink" href="#download-and-install" title="Permalink to this headline">¶</a></h2>
<p>The Android Smart Card Emulator is available on <a class="reference external" href="https://f-droid.org/repository/browse/?fdid=com.vsmartcard.remotesmartcardreader.app">F-Droid</a> <a class="footnote-reference" href="#id15" id="id16">[8]</a>.</p>
<a class="reference external image-reference" href="https://f-droid.org/repository/browse/?fdid=com.vsmartcard.acardemulator"><img alt="Android Smart Card Emulator on F-Droid" src="../_images/acardemu-qrcode.png" style="width: 265px; height: 265px;" /></a>
<p>To manually compile the app you need to fetch the sources and initialize the
submodules:</p>
<div class="highlight-sh"><div class="highlight"><pre>git clone https://github.com/frankmorgner/vsmartcard.git
<span class="nb">cd </span>vsmartcard
<span class="c"># fetch the applets that are in the submodules</span>
git submodule init
git submodule update
</pre></div>
</div>
<p>We use <a class="reference external" href="http://developer.android.com/sdk/installing/studio.html">Android Studio</a> <a class="footnote-reference" href="#id17" id="id18">[9]</a> to build and deploy the application. Use
<em class="menuselection">File ‣ Open</em> to select <tt class="file docutils literal"><span class="pre">vsmartcard/ACardEmulator</span></tt>.
Attach your smartphone and choose <em class="menuselection">Run ‣ Run ‘app’</em>.</p>
</div>
<div class="section" id="question">
<h2>Question<a class="headerlink" href="#question" title="Permalink to this headline">¶</a></h2>
<p>Do you have questions, suggestions or contributions? Feedback of any kind is
more than welcome! Please use our <a class="reference external" href="https://github.com/frankmorgner/vsmartcard/issues">project trackers</a>.</p>
</div>
<div class="section" id="notes-and-references">
<h2>Notes and References<a class="headerlink" href="#notes-and-references" title="Permalink to this headline">¶</a></h2>
<table class="docutils footnote" frame="void" id="id1" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id2">[1]</a></td><td><a class="reference external" href="http://www.jcardsim.org/">http://www.jcardsim.org/</a></td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id3" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id4">[2]</a></td><td><a class="reference external" href="https://github.com/licel/jcardsim/blob/master/src/main/java/com/licel/jcardsim/samples/HelloWorldApplet.java">https://github.com/licel/jcardsim/blob/master/src/main/java/com/licel/jcardsim/samples/HelloWorldApplet.java</a></td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id5" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id6">[3]</a></td><td><a class="reference external" href="https://developers.yubico.com/ykneo-openpgp/">https://developers.yubico.com/ykneo-openpgp/</a></td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id7" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id8">[4]</a></td><td><a class="reference external" href="https://developers.yubico.com/ykneo-oath/">https://developers.yubico.com/ykneo-oath/</a></td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id9" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id10">[5]</a></td><td><a class="reference external" href="http://www.pwendland.net/IsoApplet/">http://www.pwendland.net/IsoApplet/</a></td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id11" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id12">[6]</a></td><td><a class="reference external" href="https://github.com/vletoux/GidsApplet">https://github.com/vletoux/GidsApplet</a></td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id13" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id14">[7]</a></td><td><a class="reference external" href="https://github.com/eriknellessen/Virtual-Keycard">https://github.com/eriknellessen/Virtual-Keycard</a></td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id15" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id16">[8]</a></td><td><a class="reference external" href="https://f-droid.org/repository/browse/?fdid=com.vsmartcard.remotesmartcardreader.app">https://f-droid.org/repository/browse/?fdid=com.vsmartcard.remotesmartcardreader.app</a></td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id17" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id18">[9]</a></td><td><a class="reference external" href="http://developer.android.com/sdk/installing/studio.html">http://developer.android.com/sdk/installing/studio.html</a></td></tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
© Copyright 2009-2017 by Dominik Oepen and Frank Morgner.<br/>
</p>
</div>
</footer>
</body>
</html>
|