rebuilt documentation

This commit is contained in:
Frank Morgner
2016-10-10 12:25:54 +02:00
parent 83bd6659dc
commit 5bc798fd31
196 changed files with 53200 additions and 0 deletions

View File

@@ -0,0 +1,239 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CardGenerator Module &mdash; vsmartcard 2016-10-10 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: '2016-10-10',
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 2016-10-10 documentation" href="../../index.html" />
<link rel="up" title="virtualsmartcard Package" href="virtualsmartcard.html" />
<link rel="next" title="ConstantDefinitions Module" href="virtualsmartcard.ConstantDefinitions.html" />
<link rel="prev" title="utils_test Module" href="virtualsmartcard.tests.utils_test.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 role="document">
<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>
<li class="toctree-l1"><a class="reference internal" href="../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"><a class="reference internal" href="../../ACardEmulator/README.html">Android 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="../../npa/README.html">nPA Smart Card Library</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../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="#">CardGenerator Module</a></li>
</ul>
</ul>
</li>
<li>
<a href="virtualsmartcard.tests.utils_test.html" title="Previous Chapter: utils_test Module"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; utils_test Modul...</span>
</a>
</li>
<li>
<a href="virtualsmartcard.ConstantDefinitions.html" title="Next Chapter: ConstantDefinitions Module"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">ConstantDefiniti... &raquo;</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="cardgenerator-module">
<h1>CardGenerator Module<a class="headerlink" href="#cardgenerator-module" title="Permalink to this headline"></a></h1>
<p class="graphviz">
<img src="../../_images/inheritance-151a141442b8b2ad4b9ca6f670abcf103a9252a6.png" alt="Inheritance diagram of virtualsmartcard.CardGenerator" usemap="#inheritancecb03a25959" class="inheritance"/>
<map id="inheritancecb03a25959" name="inheritancecb03a25959">
<area shape="rect" id="node1" href="#virtualsmartcard.CardGenerator.CardGenerator" title="This class is used to generate the SAM and filesystem for the" alt="" coords="5,5,331,31"/>
</map>
</p>
<span class="target" id="module-virtualsmartcard.CardGenerator"></span><dl class="class">
<dt id="virtualsmartcard.CardGenerator.CardGenerator">
<em class="property">class </em><code class="descclassname">virtualsmartcard.CardGenerator.</code><code class="descname">CardGenerator</code><span class="sig-paren">(</span><em>card_type=None</em>, <em>sam=None</em>, <em>mf=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.CardGenerator.CardGenerator" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>This class is used to generate the SAM and filesystem for the
different supported card types. It is also able used for persistent storage
(in encrypted form) of the card on disks.</p>
<dl class="method">
<dt id="virtualsmartcard.CardGenerator.CardGenerator._CardGenerator__generate_cryptoflex">
<code class="descname">_CardGenerator__generate_cryptoflex</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.CardGenerator.CardGenerator._CardGenerator__generate_cryptoflex" title="Permalink to this definition"></a></dt>
<dd><p>Generate the Filesystem and SAM of a cryptoflex card</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.CardGenerator.CardGenerator._CardGenerator__generate_ePass">
<code class="descname">_CardGenerator__generate_ePass</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.CardGenerator.CardGenerator._CardGenerator__generate_ePass" title="Permalink to this definition"></a></dt>
<dd><p>Generate the MF and SAM of an ICAO passport. This method is
responsible for generating the filesystem and filling it with content.
Therefore it must interact with the user by prompting for the MRZ and
optionally for the path to a photo.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.CardGenerator.CardGenerator._CardGenerator__generate_iso_card">
<code class="descname">_CardGenerator__generate_iso_card</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.CardGenerator.CardGenerator._CardGenerator__generate_iso_card" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.CardGenerator.CardGenerator._CardGenerator__generate_nPA">
<code class="descname">_CardGenerator__generate_nPA</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.CardGenerator.CardGenerator._CardGenerator__generate_nPA" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.CardGenerator.CardGenerator.generateCard">
<code class="descname">generateCard</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.CardGenerator.CardGenerator.generateCard" title="Permalink to this definition"></a></dt>
<dd><p>Generate a new card</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.CardGenerator.CardGenerator.getCard">
<code class="descname">getCard</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.CardGenerator.CardGenerator.getCard" title="Permalink to this definition"></a></dt>
<dd><p>Get the MF and SAM from the current card</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.CardGenerator.CardGenerator.readDatagroups">
<code class="descname">readDatagroups</code><span class="sig-paren">(</span><em>datasetfile</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.CardGenerator.CardGenerator.readDatagroups" title="Permalink to this definition"></a></dt>
<dd><p>Read Datagroups from file</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.CardGenerator.CardGenerator.setCard">
<code class="descname">setCard</code><span class="sig-paren">(</span><em>mf=None</em>, <em>sam=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.CardGenerator.CardGenerator.setCard" title="Permalink to this definition"></a></dt>
<dd><p>Set the MF and SAM of the current card</p>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
&copy; Copyright 2009-2016 by Dominik Oepen and Frank Morgner.<br/>
</p>
</div>
</footer>
</body>
</html>

View File

@@ -0,0 +1,175 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ConstantDefinitions Module &mdash; vsmartcard 2016-10-10 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: '2016-10-10',
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 2016-10-10 documentation" href="../../index.html" />
<link rel="up" title="virtualsmartcard Package" href="virtualsmartcard.html" />
<link rel="next" title="CryptoUtils Module" href="virtualsmartcard.CryptoUtils.html" />
<link rel="prev" title="CardGenerator Module" href="virtualsmartcard.CardGenerator.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 role="document">
<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>
<li class="toctree-l1"><a class="reference internal" href="../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"><a class="reference internal" href="../../ACardEmulator/README.html">Android 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="../../npa/README.html">nPA Smart Card Library</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../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="#">ConstantDefinitions Module</a></li>
</ul>
</ul>
</li>
<li>
<a href="virtualsmartcard.CardGenerator.html" title="Previous Chapter: CardGenerator Module"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; CardGenerator Mo...</span>
</a>
</li>
<li>
<a href="virtualsmartcard.CryptoUtils.html" title="Next Chapter: CryptoUtils Module"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">CryptoUtils Modu... &raquo;</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="constantdefinitions-module">
<h1>ConstantDefinitions Module<a class="headerlink" href="#constantdefinitions-module" title="Permalink to this headline"></a></h1>
<span class="target" id="module-virtualsmartcard.ConstantDefinitions"></span></div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
&copy; Copyright 2009-2016 by Dominik Oepen and Frank Morgner.<br/>
</p>
</div>
</footer>
</body>
</html>

View File

@@ -0,0 +1,270 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CryptoUtils Module &mdash; vsmartcard 2016-10-10 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: '2016-10-10',
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 2016-10-10 documentation" href="../../index.html" />
<link rel="up" title="virtualsmartcard Package" href="virtualsmartcard.html" />
<link rel="next" title="SEutils Module" href="virtualsmartcard.SEutils.html" />
<link rel="prev" title="ConstantDefinitions Module" href="virtualsmartcard.ConstantDefinitions.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 role="document">
<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>
<li class="toctree-l1"><a class="reference internal" href="../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"><a class="reference internal" href="../../ACardEmulator/README.html">Android 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="../../npa/README.html">nPA Smart Card Library</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../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="#">CryptoUtils Module</a></li>
</ul>
</ul>
</li>
<li>
<a href="virtualsmartcard.ConstantDefinitions.html" title="Previous Chapter: ConstantDefinitions Module"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; ConstantDefiniti...</span>
</a>
</li>
<li>
<a href="virtualsmartcard.SEutils.html" title="Next Chapter: SEutils Module"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">SEutils Module &raquo;</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="cryptoutils-module">
<h1>CryptoUtils Module<a class="headerlink" href="#cryptoutils-module" title="Permalink to this headline"></a></h1>
<span class="target" id="module-virtualsmartcard.CryptoUtils"></span><dl class="function">
<dt id="virtualsmartcard.CryptoUtils._makesalt">
<code class="descclassname">virtualsmartcard.CryptoUtils.</code><code class="descname">_makesalt</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.CryptoUtils._makesalt" title="Permalink to this definition"></a></dt>
<dd><p>Return a 48-bit pseudorandom salt for crypt().</p>
<p>This function is not suitable for generating cryptographic secrets.</p>
</dd></dl>
<dl class="function">
<dt id="virtualsmartcard.CryptoUtils.append_padding">
<code class="descclassname">virtualsmartcard.CryptoUtils.</code><code class="descname">append_padding</code><span class="sig-paren">(</span><em>blocklen</em>, <em>data</em>, <em>padding_class=1</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.CryptoUtils.append_padding" title="Permalink to this definition"></a></dt>
<dd><p>Append padding to the data.
Length of padding depends on length of data and the block size of the
specified encryption algorithm.
Different types of padding may be selected via the padding_class parameter</p>
</dd></dl>
<dl class="function">
<dt id="virtualsmartcard.CryptoUtils.calculate_MAC">
<code class="descclassname">virtualsmartcard.CryptoUtils.</code><code class="descname">calculate_MAC</code><span class="sig-paren">(</span><em>session_key</em>, <em>message</em>, <em>iv='\x00\x00\x00\x00\x00\x00\x00\x00'</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.CryptoUtils.calculate_MAC" title="Permalink to this definition"></a></dt>
<dd><p>Cyberflex MAC is the last Block of the input encrypted with DES3-CBC</p>
</dd></dl>
<dl class="function">
<dt id="virtualsmartcard.CryptoUtils.cipher">
<code class="descclassname">virtualsmartcard.CryptoUtils.</code><code class="descname">cipher</code><span class="sig-paren">(</span><em>do_encrypt</em>, <em>cipherspec</em>, <em>key</em>, <em>data</em>, <em>iv=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.CryptoUtils.cipher" title="Permalink to this definition"></a></dt>
<dd><p>Do a cryptographic operation.
operation = do_encrypt ? encrypt : decrypt,
cipherspec must be of the form &#8220;cipher-mode&#8221;, or &#8220;cipher&#8221;</p>
</dd></dl>
<dl class="function">
<dt id="virtualsmartcard.CryptoUtils.crypto_checksum">
<code class="descclassname">virtualsmartcard.CryptoUtils.</code><code class="descname">crypto_checksum</code><span class="sig-paren">(</span><em>algo</em>, <em>key</em>, <em>data</em>, <em>iv=None</em>, <em>ssc=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.CryptoUtils.crypto_checksum" title="Permalink to this definition"></a></dt>
<dd><p>Compute various types of cryptographic checksums.</p>
<table class="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">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>algo</strong> &#8211; A string specifying the algorithm to use. Currently supported
algorithms are &#8220;MAX&#8221; &#8220;HMAC&#8221; and &#8220;CC&#8221; (Meaning a cryptographic
checksum as used by the ICAO passports)</li>
<li><strong>key</strong> &#8211; They key used to computed the cryptographic checksum</li>
<li><strong>data</strong> &#8211; The data for which to calculate the checksum</li>
<li><strong>iv</strong> &#8211; Optional. An initialization vector. Only used by the &#8220;MAC&#8221; algorithm</li>
<li><strong>ssc</strong> &#8211; Optional. A send sequence counter to be prepended to the data.
Only used by the &#8220;CC&#8221; algorithm</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="virtualsmartcard.CryptoUtils.decrypt">
<code class="descclassname">virtualsmartcard.CryptoUtils.</code><code class="descname">decrypt</code><span class="sig-paren">(</span><em>cipherspec</em>, <em>key</em>, <em>data</em>, <em>iv=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.CryptoUtils.decrypt" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="virtualsmartcard.CryptoUtils.encrypt">
<code class="descclassname">virtualsmartcard.CryptoUtils.</code><code class="descname">encrypt</code><span class="sig-paren">(</span><em>cipherspec</em>, <em>key</em>, <em>data</em>, <em>iv=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.CryptoUtils.encrypt" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="virtualsmartcard.CryptoUtils.get_cipher">
<code class="descclassname">virtualsmartcard.CryptoUtils.</code><code class="descname">get_cipher</code><span class="sig-paren">(</span><em>cipherspec</em>, <em>key</em>, <em>iv=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.CryptoUtils.get_cipher" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="virtualsmartcard.CryptoUtils.get_cipher_blocklen">
<code class="descclassname">virtualsmartcard.CryptoUtils.</code><code class="descname">get_cipher_blocklen</code><span class="sig-paren">(</span><em>cipherspec</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.CryptoUtils.get_cipher_blocklen" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="virtualsmartcard.CryptoUtils.get_cipher_keylen">
<code class="descclassname">virtualsmartcard.CryptoUtils.</code><code class="descname">get_cipher_keylen</code><span class="sig-paren">(</span><em>cipherspec</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.CryptoUtils.get_cipher_keylen" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="virtualsmartcard.CryptoUtils.hash">
<code class="descclassname">virtualsmartcard.CryptoUtils.</code><code class="descname">hash</code><span class="sig-paren">(</span><em>hashmethod</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.CryptoUtils.hash" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="virtualsmartcard.CryptoUtils.operation_on_string">
<code class="descclassname">virtualsmartcard.CryptoUtils.</code><code class="descname">operation_on_string</code><span class="sig-paren">(</span><em>string1</em>, <em>string2</em>, <em>op</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.CryptoUtils.operation_on_string" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="virtualsmartcard.CryptoUtils.strip_padding">
<code class="descclassname">virtualsmartcard.CryptoUtils.</code><code class="descname">strip_padding</code><span class="sig-paren">(</span><em>blocklen</em>, <em>data</em>, <em>padding_class=1</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.CryptoUtils.strip_padding" title="Permalink to this definition"></a></dt>
<dd><p>Strip the padding of decrypted data. Returns data without padding</p>
</dd></dl>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
&copy; Copyright 2009-2016 by Dominik Oepen and Frank Morgner.<br/>
</p>
</div>
</footer>
</body>
</html>

View File

@@ -0,0 +1,648 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SEutils Module &mdash; vsmartcard 2016-10-10 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: '2016-10-10',
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 2016-10-10 documentation" href="../../index.html" />
<link rel="up" title="virtualsmartcard Package" href="virtualsmartcard.html" />
<link rel="next" title="SWutils Module" href="virtualsmartcard.SWutils.html" />
<link rel="prev" title="CryptoUtils Module" href="virtualsmartcard.CryptoUtils.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 role="document">
<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>
<li class="toctree-l1"><a class="reference internal" href="../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"><a class="reference internal" href="../../ACardEmulator/README.html">Android 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="../../npa/README.html">nPA Smart Card Library</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../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="#">SEutils Module</a></li>
</ul>
</ul>
</li>
<li>
<a href="virtualsmartcard.CryptoUtils.html" title="Previous Chapter: CryptoUtils Module"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; CryptoUtils Modu...</span>
</a>
</li>
<li>
<a href="virtualsmartcard.SWutils.html" title="Next Chapter: SWutils Module"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">SWutils Module &raquo;</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="seutils-module">
<h1>SEutils Module<a class="headerlink" href="#seutils-module" title="Permalink to this headline"></a></h1>
<p class="graphviz">
<img src="../../_images/inheritance-9f3c7bc88811fee87e07a30133f7586cb9c7a2ee.png" alt="Inheritance diagram of virtualsmartcard.SEutils" usemap="#inheritance7064aeb8f6" class="inheritance"/>
<map id="inheritance7064aeb8f6" name="inheritance7064aeb8f6">
<area shape="rect" id="node1" href="#virtualsmartcard.SEutils.ControlReferenceTemplate" title="Control Reference Templates are used to configure the Security" alt="" coords="5,55,353,80"/>
<area shape="rect" id="node2" href="#virtualsmartcard.SEutils.Security_Environment" title="virtualsmartcard.SEutils.Security_Environment" alt="" coords="20,5,339,31"/>
</map>
</p>
<span class="target" id="module-virtualsmartcard.SEutils"></span><dl class="class">
<dt id="virtualsmartcard.SEutils.ControlReferenceTemplate">
<em class="property">class </em><code class="descclassname">virtualsmartcard.SEutils.</code><code class="descname">ControlReferenceTemplate</code><span class="sig-paren">(</span><em>tag</em>, <em>config=''</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SEutils.ControlReferenceTemplate" title="Permalink to this definition"></a></dt>
<dd><p>Control Reference Templates are used to configure the Security
Environments. They specify which algorithms to use in which mode of
operation and with which keys. There are six different types of Control
Reference Template:
HT, AT, KT, CCT, DST, CT-sym, CT-asym.</p>
<dl class="method">
<dt id="virtualsmartcard.SEutils.ControlReferenceTemplate._ControlReferenceTemplate__replace_tag">
<code class="descname">_ControlReferenceTemplate__replace_tag</code><span class="sig-paren">(</span><em>tag</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SEutils.ControlReferenceTemplate._ControlReferenceTemplate__replace_tag" title="Permalink to this definition"></a></dt>
<dd><p>Adjust the config string using a given tag, value combination. If the
config string already contains a tag, value pair for the given tag,
replace it. Otherwise append tag, length and value to the config
string.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.ControlReferenceTemplate._ControlReferenceTemplate__set_algo">
<code class="descname">_ControlReferenceTemplate__set_algo</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SEutils.ControlReferenceTemplate._ControlReferenceTemplate__set_algo" title="Permalink to this definition"></a></dt>
<dd><p>Set the algorithm to be used by this CRT. The algorithms are specified
in a global dictionary. New cards may add or modify this table in order
to support new or different algorithms.</p>
<table class="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">Parameters:</th><td class="field-body"><strong>data</strong> &#8211; reference to an algorithm</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.ControlReferenceTemplate._ControlReferenceTemplate__set_iv">
<code class="descname">_ControlReferenceTemplate__set_iv</code><span class="sig-paren">(</span><em>tag</em>, <em>length</em>, <em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SEutils.ControlReferenceTemplate._ControlReferenceTemplate__set_iv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.ControlReferenceTemplate._ControlReferenceTemplate__set_key">
<code class="descname">_ControlReferenceTemplate__set_key</code><span class="sig-paren">(</span><em>tag</em>, <em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SEutils.ControlReferenceTemplate._ControlReferenceTemplate__set_key" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.ControlReferenceTemplate.parse_SE_config">
<code class="descname">parse_SE_config</code><span class="sig-paren">(</span><em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SEutils.ControlReferenceTemplate.parse_SE_config" title="Permalink to this definition"></a></dt>
<dd><p>Parse a control reference template as given e.g. in an MSE APDU.</p>
<table class="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">Parameters:</th><td class="field-body"><strong>config</strong> &#8211; a TLV string containing the configuration for the CRT.</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.ControlReferenceTemplate.to_string">
<code class="descname">to_string</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SEutils.ControlReferenceTemplate.to_string" title="Permalink to this definition"></a></dt>
<dd><p>Return the content of the CRT, encoded as TLV data in a string</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="virtualsmartcard.SEutils.Security_Environment">
<em class="property">class </em><code class="descclassname">virtualsmartcard.SEutils.</code><code class="descname">Security_Environment</code><span class="sig-paren">(</span><em>MF</em>, <em>SAM</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment._set_SE">
<code class="descname">_set_SE</code><span class="sig-paren">(</span><em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment._set_SE" title="Permalink to this definition"></a></dt>
<dd><p>Manipulate the current Security Environment. P2 is the tag of a
control reference template, data contains control reference objects</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.compute_cryptographic_checksum">
<code class="descname">compute_cryptographic_checksum</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.compute_cryptographic_checksum" title="Permalink to this definition"></a></dt>
<dd><p>Compute a cryptographic checksum (e.g. MAC) for the given data.
Algorithm and key are specified in the current SE</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.compute_digital_signature">
<code class="descname">compute_digital_signature</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.compute_digital_signature" title="Permalink to this definition"></a></dt>
<dd><p>Compute a digital signature for the given data.
Algorithm and key are specified in the current SE</p>
<table class="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">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>p1</strong> &#8211; Must be 0x9E = Secure Messaging class for digital signatures</li>
<li><strong>p2</strong> &#8211; Must be one of 0x9A, 0xAC, 0xBC. Indicates what kind of data
is included in the data field.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.decipher">
<code class="descname">decipher</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.decipher" title="Permalink to this definition"></a></dt>
<dd><p>Decipher data using key, algorithm, IV and Padding specified
by the current Security environment.</p>
<table class="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">Returns:</th><td class="field-body">raw data (no TLV coding). Padding is not removed!!!</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.encipher">
<code class="descname">encipher</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.encipher" title="Permalink to this definition"></a></dt>
<dd><p>Encipher data using key, algorithm, IV and Padding specified
by the current Security environment.</p>
<table class="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">Returns:</th><td class="field-body">raw data (no TLV coding).</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.generate_public_key_pair">
<code class="descname">generate_public_key_pair</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.generate_public_key_pair" title="Permalink to this definition"></a></dt>
<dd><p>The GENERATE PUBLIC-KEY PAIR command either initiates the generation
and storing of a key pair, i.e., a public key and a private key, in the
card, or accesses a key pair previously generated in the card.</p>
<table class="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">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>p1</strong> &#8211; should be 0x00 (generate new key)</li>
<li><strong>p2</strong> &#8211; &#8216;00&#8217; (no information provided) or reference of the key to
be generated</li>
<li><strong>data</strong> &#8211; One or more CRTs associated to the key generation if
P1-P2 different from &#8216;0000&#8217;</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.hash">
<code class="descname">hash</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.hash" title="Permalink to this definition"></a></dt>
<dd><p>Hash the given data using the algorithm specified by the current
Security environment.</p>
<table class="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">Returns:</th><td class="field-body">raw data (no TLV coding).</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.manage_security_environment">
<code class="descname">manage_security_environment</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.manage_security_environment" title="Permalink to this definition"></a></dt>
<dd><p>This method is used to store, restore or erase Security Environments
or to manipulate the various parameters of the current SE.
P1 specifies the operation to perform, p2 is either the SEID for the
referred SE or the tag of a control reference template</p>
<table class="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">Parameters:</th><td class="field-body"><strong>p1</strong> &#8211; <p>Bitmask according to this table</p>
<table border="1" class="docutils">
<colgroup>
<col width="4%" />
<col width="4%" />
<col width="4%" />
<col width="4%" />
<col width="4%" />
<col width="4%" />
<col width="4%" />
<col width="4%" />
<col width="71%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">b8</th>
<th class="head">b7</th>
<th class="head">b6</th>
<th class="head">b5</th>
<th class="head">b4</th>
<th class="head">b3</th>
<th class="head">b2</th>
<th class="head">b1</th>
<th class="head">Meaning</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td>1</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td>Secure messaging in command data field</td>
</tr>
<tr class="row-odd"><td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td>1</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td>Secure messaging in response data field</td>
</tr>
<tr class="row-even"><td><ul class="first last simple">
<li></li>
</ul>
</td>
<td>1</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td>Computation, decipherment, internal
authentication and key agreement</td>
</tr>
<tr class="row-odd"><td>1</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td>Verification, encipherment, external
authentication and key agreement</td>
</tr>
<tr class="row-even"><td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>SET</td>
</tr>
<tr class="row-odd"><td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>STORE</td>
</tr>
<tr class="row-even"><td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>RESTORE</td>
</tr>
<tr class="row-odd"><td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>ERASE</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.parse_SM_CAPDU">
<code class="descname">parse_SM_CAPDU</code><span class="sig-paren">(</span><em>CAPDU</em>, <em>authenticate_header</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.parse_SM_CAPDU" title="Permalink to this definition"></a></dt>
<dd><p>This methods parses a data field including Secure Messaging objects.
SM_header indicates whether or not the header of the message shall be
authenticated. It returns an unprotected command APDU</p>
<table class="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">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>CAPDU</strong> &#8211; The protected CAPDU to be parsed</li>
<li><strong>authenticate_header</strong> &#8211; Whether or not the header should be
included in authentication mechanisms</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Unprotected command APDU</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.perform_security_operation">
<code class="descname">perform_security_operation</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.perform_security_operation" title="Permalink to this definition"></a></dt>
<dd><p>In the end this command is nothing but a big switch for all the other
commands in ISO 7816-8. It will invoke the appropriate command and
return its result</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.protect_response">
<code class="descname">protect_response</code><span class="sig-paren">(</span><em>sw</em>, <em>result</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.protect_response" title="Permalink to this definition"></a></dt>
<dd><p>This method protects a response APDU using secure messaging mechanisms</p>
<table class="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">Returns:</th><td class="field-body">the protected data and the SW bytes</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.verify_certificate">
<code class="descname">verify_certificate</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.verify_certificate" title="Permalink to this definition"></a></dt>
<dd><p>Verify a certificate send by the terminal using the internal trust
anchors.
This method is currently not implemented.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.verify_cryptographic_checksum">
<code class="descname">verify_cryptographic_checksum</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.verify_cryptographic_checksum" title="Permalink to this definition"></a></dt>
<dd><p>Verify the cryptographic checksum contained in the data field.
Data field must contain a cryptographic checksum (tag 0x8E) and a plain
value (tag 0x80)</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.verify_digital_signature">
<code class="descname">verify_digital_signature</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.verify_digital_signature" title="Permalink to this definition"></a></dt>
<dd><p>Verify the digital signature contained in the data field. Data must
contain a data to sign (tag 0x9A, 0xAC or 0xBC) and a digital signature
(0x9E)</p>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
&copy; Copyright 2009-2016 by Dominik Oepen and Frank Morgner.<br/>
</p>
</div>
</footer>
</body>
</html>

View File

@@ -0,0 +1,197 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SWutils Module &mdash; vsmartcard 2016-10-10 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: '2016-10-10',
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 2016-10-10 documentation" href="../../index.html" />
<link rel="up" title="virtualsmartcard Package" href="virtualsmartcard.html" />
<link rel="next" title="SmartcardFilesystem Module" href="virtualsmartcard.SmartcardFilesystem.html" />
<link rel="prev" title="SEutils Module" href="virtualsmartcard.SEutils.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 role="document">
<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>
<li class="toctree-l1"><a class="reference internal" href="../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"><a class="reference internal" href="../../ACardEmulator/README.html">Android 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="../../npa/README.html">nPA Smart Card Library</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../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="#">SWutils Module</a></li>
</ul>
</ul>
</li>
<li>
<a href="virtualsmartcard.SEutils.html" title="Previous Chapter: SEutils Module"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; SEutils Module</span>
</a>
</li>
<li>
<a href="virtualsmartcard.SmartcardFilesystem.html" title="Next Chapter: SmartcardFilesystem Module"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">SmartcardFilesys... &raquo;</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="swutils-module">
<h1>SWutils Module<a class="headerlink" href="#swutils-module" title="Permalink to this headline"></a></h1>
<p class="graphviz">
<img src="../../_images/inheritance-2df37359f5f3e9e8ae5b3298a982b18985d97b0f.png" alt="Inheritance diagram of virtualsmartcard.SWutils" usemap="#inheritancef021466e51" class="inheritance"/>
<map id="inheritancef021466e51" name="inheritancef021466e51">
<area shape="rect" id="node1" href="#virtualsmartcard.SWutils.SwError" title="virtualsmartcard.SWutils.SwError" alt="" coords="5,5,239,31"/>
</map>
</p>
<span class="target" id="module-virtualsmartcard.SWutils"></span><dl class="exception">
<dt id="virtualsmartcard.SWutils.SwError">
<em class="property">exception </em><code class="descclassname">virtualsmartcard.SWutils.</code><code class="descname">SwError</code><span class="sig-paren">(</span><em>sw</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SWutils.SwError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></code></p>
<dl class="attribute">
<dt id="virtualsmartcard.SWutils.SwError.args">
<code class="descname">args</code><a class="headerlink" href="#virtualsmartcard.SWutils.SwError.args" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.SWutils.SwError.message">
<code class="descname">message</code><a class="headerlink" href="#virtualsmartcard.SWutils.SwError.message" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
&copy; Copyright 2009-2016 by Dominik Oepen and Frank Morgner.<br/>
</p>
</div>
</footer>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,475 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SmartcardSAM Module &mdash; vsmartcard 2016-10-10 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: '2016-10-10',
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 2016-10-10 documentation" href="../../index.html" />
<link rel="up" title="virtualsmartcard Package" href="virtualsmartcard.html" />
<link rel="next" title="TLVutils Module" href="virtualsmartcard.TLVutils.html" />
<link rel="prev" title="SmartcardFilesystem Module" href="virtualsmartcard.SmartcardFilesystem.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 role="document">
<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>
<li class="toctree-l1"><a class="reference internal" href="../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"><a class="reference internal" href="../../ACardEmulator/README.html">Android 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="../../npa/README.html">nPA Smart Card Library</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../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="#">SmartcardSAM Module</a></li>
</ul>
</ul>
</li>
<li>
<a href="virtualsmartcard.SmartcardFilesystem.html" title="Previous Chapter: SmartcardFilesystem Module"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; SmartcardFilesys...</span>
</a>
</li>
<li>
<a href="virtualsmartcard.TLVutils.html" title="Next Chapter: TLVutils Module"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">TLVutils Module &raquo;</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="smartcardsam-module">
<h1>SmartcardSAM Module<a class="headerlink" href="#smartcardsam-module" title="Permalink to this headline"></a></h1>
<p class="graphviz">
<img src="../../_images/inheritance-2bbcd7895a62e5ec48d90ac42e0891ae2f9feca4.png" alt="Inheritance diagram of virtualsmartcard.SmartcardSAM" usemap="#inheritance8b3e5dd7ee" class="inheritance"/>
<map id="inheritance8b3e5dd7ee" name="inheritance8b3e5dd7ee">
<area shape="rect" id="node1" href="#virtualsmartcard.SmartcardSAM.SAM" title="This class is used to store the data needed by the SAM." alt="" coords="5,5,263,31"/>
</map>
</p>
<span class="target" id="module-virtualsmartcard.SmartcardSAM"></span><dl class="class">
<dt id="virtualsmartcard.SmartcardSAM.SAM">
<em class="property">class </em><code class="descclassname">virtualsmartcard.SmartcardSAM.</code><code class="descname">SAM</code><span class="sig-paren">(</span><em>PIN</em>, <em>cardNumber</em>, <em>mf=None</em>, <em>cardSecret=None</em>, <em>default_se=&lt;class 'virtualsmartcard.SEutils.Security_Environment'&gt;</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>This class is used to store the data needed by the SAM.
It includes the PIN, the master key of the SAM and a hashmap containing all
the keys used by the file encryption system. The keys in the hashmap are
indexed via the path to the corresponding container.</p>
<dl class="method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.FSdecrypt">
<code class="descname">FSdecrypt</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.FSdecrypt" title="Permalink to this definition"></a></dt>
<dd><p>Decrypt the given data, using the parameters stored in the SAM.
Right now we do not encrypt the data. In memory encryption might or
might not be added in a future version.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.FSencrypt">
<code class="descname">FSencrypt</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.FSencrypt" title="Permalink to this definition"></a></dt>
<dd><p>Encrypt the given data, using the parameters stored in the SAM.
Right now we do not encrypt the data. In memory encryption might or
might not be added in a future version.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SmartcardSAM.SAM._get_referenced_key">
<code class="descname">_get_referenced_key</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM._get_referenced_key" title="Permalink to this definition"></a></dt>
<dd><p>This method returns the key specified by the p2 parameter. The key may
be stored on the cards filesystem.</p>
<table class="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">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>p1</strong> &#8211; Specifies the algorithm to use.</li>
<li><strong>p2</strong> &#8211; <p>Specifies a reference to the key to be used for encryption.</p>
<table border="1" class="docutils">
<colgroup>
<col width="3%" />
<col width="3%" />
<col width="3%" />
<col width="3%" />
<col width="3%" />
<col width="3%" />
<col width="3%" />
<col width="3%" />
<col width="73%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">b8</th>
<th class="head">b7</th>
<th class="head">b6</th>
<th class="head">b5</th>
<th class="head">b4</th>
<th class="head">b3</th>
<th class="head">b2</th>
<th class="head">b1</th>
<th class="head">Meaning</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>No information is given</td>
</tr>
<tr class="row-odd"><td>0</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td>Global reference data(e.g. MF specific key)</td>
</tr>
<tr class="row-even"><td>1</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td>Specific reference data(e.g. DF specific
key)</td>
</tr>
<tr class="row-odd"><td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>Number of the secret</td>
</tr>
</tbody>
</table>
<p>Any other value RFU</p>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.change_reference_data">
<code class="descname">change_reference_data</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.change_reference_data" title="Permalink to this definition"></a></dt>
<dd><p>Change the specified referenced data (e.g. CHV) of the card</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.erase_SE">
<code class="descname">erase_SE</code><span class="sig-paren">(</span><em>SEID</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.erase_SE" title="Permalink to this definition"></a></dt>
<dd><p>Erases a Security Environment stored under SEID from the SAM</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.external_authenticate">
<code class="descname">external_authenticate</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.external_authenticate" title="Permalink to this definition"></a></dt>
<dd><p>Authenticate the terminal to the card. Check whether Terminal correctly
encrypted the given challenge or not</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.generate_public_key_pair">
<code class="descname">generate_public_key_pair</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.generate_public_key_pair" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.get_card_number">
<code class="descname">get_card_number</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.get_card_number" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.get_challenge">
<code class="descname">get_challenge</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.get_challenge" title="Permalink to this definition"></a></dt>
<dd><p>Generate a random number of maximum 8 Byte and return it.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.internal_authenticate">
<code class="descname">internal_authenticate</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.internal_authenticate" title="Permalink to this definition"></a></dt>
<dd><p>Authenticate card to terminal. Encrypt the challenge of the terminal
to prove key posession</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.manage_security_environment">
<code class="descname">manage_security_environment</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.manage_security_environment" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.mutual_authenticate">
<code class="descname">mutual_authenticate</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>mutual_challenge</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.mutual_authenticate" title="Permalink to this definition"></a></dt>
<dd><p>Takes an encrypted challenge in the form
&#8216;Terminal Challenge | Card Challenge | Card number&#8217;
and checks it for validity. If the challenge is successful
the card encrypts &#8216;Card Challenge | Terminal challenge&#8217; and
returns this value</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.parse_SM_CAPDU">
<code class="descname">parse_SM_CAPDU</code><span class="sig-paren">(</span><em>CAPDU</em>, <em>header_authentication</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.parse_SM_CAPDU" title="Permalink to this definition"></a></dt>
<dd><p>Parse a command APDU protected by Secure Messaging and return the
unprotected command APDU</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.perform_security_operation">
<code class="descname">perform_security_operation</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.perform_security_operation" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.protect_result">
<code class="descname">protect_result</code><span class="sig-paren">(</span><em>sw</em>, <em>unprotected_result</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.protect_result" title="Permalink to this definition"></a></dt>
<dd><p>Protect a plain response APDU by Secure Messaging</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.restore_SE">
<code class="descname">restore_SE</code><span class="sig-paren">(</span><em>SEID</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.restore_SE" title="Permalink to this definition"></a></dt>
<dd><p>Restores a Security Environment from the SAM and replaces the current
SE with it.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.set_MF">
<code class="descname">set_MF</code><span class="sig-paren">(</span><em>mf</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.set_MF" title="Permalink to this definition"></a></dt>
<dd><p>Setter function for the internal reference to the Filesystem. The SAM
needs a reference to the filesystem in order to store/retrieve keys.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.set_asym_algorithm">
<code class="descname">set_asym_algorithm</code><span class="sig-paren">(</span><em>cipher</em>, <em>keytype</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.set_asym_algorithm" title="Permalink to this definition"></a></dt>
<dd><table class="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">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>cipher</strong> &#8211; Public/private key object from used for encryption</li>
<li><strong>keytype</strong> &#8211; Type of the public key (e.g. RSA, DSA)</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.store_SE">
<code class="descname">store_SE</code><span class="sig-paren">(</span><em>SEID</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.store_SE" title="Permalink to this definition"></a></dt>
<dd><p>Stores the current Security environment in the secure access module.
The SEID is used as a reference to identify the SE.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.verify">
<code class="descname">verify</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>PIN</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.verify" title="Permalink to this definition"></a></dt>
<dd><p>Authenticate the card user. Check if he entered a valid PIN.
If the PIN is invalid decrement retry counter. If retry counter
equals zero, block the card until reset with correct PUK</p>
</dd></dl>
</dd></dl>
<dl class="function">
<dt id="virtualsmartcard.SmartcardSAM.get_referenced_cipher">
<code class="descclassname">virtualsmartcard.SmartcardSAM.</code><code class="descname">get_referenced_cipher</code><span class="sig-paren">(</span><em>p1</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.get_referenced_cipher" title="Permalink to this definition"></a></dt>
<dd><p>P1 defines the algorithm and mode to use. We dispatch it and return a
string that is understood by CryptoUtils.py functions</p>
</dd></dl>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
&copy; Copyright 2009-2016 by Dominik Oepen and Frank Morgner.<br/>
</p>
</div>
</footer>
</body>
</html>

View File

@@ -0,0 +1,272 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TLVutils Module &mdash; vsmartcard 2016-10-10 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: '2016-10-10',
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 2016-10-10 documentation" href="../../index.html" />
<link rel="up" title="virtualsmartcard Package" href="virtualsmartcard.html" />
<link rel="next" title="VirtualSmartcard Module" href="virtualsmartcard.VirtualSmartcard.html" />
<link rel="prev" title="SmartcardSAM Module" href="virtualsmartcard.SmartcardSAM.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 role="document">
<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>
<li class="toctree-l1"><a class="reference internal" href="../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"><a class="reference internal" href="../../ACardEmulator/README.html">Android 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="../../npa/README.html">nPA Smart Card Library</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../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="#">TLVutils Module</a></li>
</ul>
</ul>
</li>
<li>
<a href="virtualsmartcard.SmartcardSAM.html" title="Previous Chapter: SmartcardSAM Module"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; SmartcardSAM Mod...</span>
</a>
</li>
<li>
<a href="virtualsmartcard.VirtualSmartcard.html" title="Next Chapter: VirtualSmartcard Module"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">VirtualSmartcard... &raquo;</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="tlvutils-module">
<h1>TLVutils Module<a class="headerlink" href="#tlvutils-module" title="Permalink to this headline"></a></h1>
<span class="target" id="module-virtualsmartcard.TLVutils"></span><dl class="function">
<dt id="virtualsmartcard.TLVutils.bertlv_pack">
<code class="descclassname">virtualsmartcard.TLVutils.</code><code class="descname">bertlv_pack</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.TLVutils.bertlv_pack" title="Permalink to this definition"></a></dt>
<dd><p>Packs a bertlv list of 3-tuples (tag, length, newvalue) into a string</p>
</dd></dl>
<dl class="function">
<dt id="virtualsmartcard.TLVutils.bertlv_unpack">
<code class="descclassname">virtualsmartcard.TLVutils.</code><code class="descname">bertlv_unpack</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.TLVutils.bertlv_unpack" title="Permalink to this definition"></a></dt>
<dd><p>Unpacks a bertlv coded string into a list of 3-tuples (tag, length,
newvalue).</p>
</dd></dl>
<dl class="function">
<dt id="virtualsmartcard.TLVutils.decodeDiscretionaryDataObjects">
<code class="descclassname">virtualsmartcard.TLVutils.</code><code class="descname">decodeDiscretionaryDataObjects</code><span class="sig-paren">(</span><em>tlv_data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.TLVutils.decodeDiscretionaryDataObjects" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="virtualsmartcard.TLVutils.decodeExtendedHeaderList">
<code class="descclassname">virtualsmartcard.TLVutils.</code><code class="descname">decodeExtendedHeaderList</code><span class="sig-paren">(</span><em>tlv_data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.TLVutils.decodeExtendedHeaderList" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="virtualsmartcard.TLVutils.decodeHeaderList">
<code class="descclassname">virtualsmartcard.TLVutils.</code><code class="descname">decodeHeaderList</code><span class="sig-paren">(</span><em>tlv_data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.TLVutils.decodeHeaderList" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="virtualsmartcard.TLVutils.decodeOffsetDataObjects">
<code class="descclassname">virtualsmartcard.TLVutils.</code><code class="descname">decodeOffsetDataObjects</code><span class="sig-paren">(</span><em>tlv_data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.TLVutils.decodeOffsetDataObjects" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="virtualsmartcard.TLVutils.decodeTagList">
<code class="descclassname">virtualsmartcard.TLVutils.</code><code class="descname">decodeTagList</code><span class="sig-paren">(</span><em>tlv_data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.TLVutils.decodeTagList" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="virtualsmartcard.TLVutils.encodeDataOffsetObjects">
<code class="descclassname">virtualsmartcard.TLVutils.</code><code class="descname">encodeDataOffsetObjects</code><span class="sig-paren">(</span><em>datalist</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.TLVutils.encodeDataOffsetObjects" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="virtualsmartcard.TLVutils.encodeDiscretionaryDataObjects">
<code class="descclassname">virtualsmartcard.TLVutils.</code><code class="descname">encodeDiscretionaryDataObjects</code><span class="sig-paren">(</span><em>datalist</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.TLVutils.encodeDiscretionaryDataObjects" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="virtualsmartcard.TLVutils.encodebertlvDatalist">
<code class="descclassname">virtualsmartcard.TLVutils.</code><code class="descname">encodebertlvDatalist</code><span class="sig-paren">(</span><em>tag</em>, <em>datalist</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.TLVutils.encodebertlvDatalist" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="virtualsmartcard.TLVutils.pack">
<code class="descclassname">virtualsmartcard.TLVutils.</code><code class="descname">pack</code><span class="sig-paren">(</span><em>tlv_data</em>, <em>recalculate_length=False</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.TLVutils.pack" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="virtualsmartcard.TLVutils.simpletlv_pack">
<code class="descclassname">virtualsmartcard.TLVutils.</code><code class="descname">simpletlv_pack</code><span class="sig-paren">(</span><em>tlv_data</em>, <em>recalculate_length=False</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.TLVutils.simpletlv_pack" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="virtualsmartcard.TLVutils.simpletlv_unpack">
<code class="descclassname">virtualsmartcard.TLVutils.</code><code class="descname">simpletlv_unpack</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.TLVutils.simpletlv_unpack" title="Permalink to this definition"></a></dt>
<dd><p>Unpacks a simpletlv coded string into a list of 3-tuples (tag, length,
newvalue).</p>
</dd></dl>
<dl class="function">
<dt id="virtualsmartcard.TLVutils.tlv_find_tag">
<code class="descclassname">virtualsmartcard.TLVutils.</code><code class="descname">tlv_find_tag</code><span class="sig-paren">(</span><em>tlv_data</em>, <em>tag</em>, <em>num_results=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.TLVutils.tlv_find_tag" title="Permalink to this definition"></a></dt>
<dd><p>Find (and return) all instances of tag in the given tlv structure (as
returned by unpack).
If num_results is specified then at most that many results will be
returned.</p>
</dd></dl>
<dl class="function">
<dt id="virtualsmartcard.TLVutils.tlv_find_tags">
<code class="descclassname">virtualsmartcard.TLVutils.</code><code class="descname">tlv_find_tags</code><span class="sig-paren">(</span><em>tlv_data</em>, <em>tags</em>, <em>num_results=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.TLVutils.tlv_find_tags" title="Permalink to this definition"></a></dt>
<dd><p>Find (and return) all instances of tags in the given tlv structure (as
returned by unpack). If num_results is specified then at most that many
results will be returned.</p>
</dd></dl>
<dl class="function">
<dt id="virtualsmartcard.TLVutils.tlv_unpack">
<code class="descclassname">virtualsmartcard.TLVutils.</code><code class="descname">tlv_unpack</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.TLVutils.tlv_unpack" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="virtualsmartcard.TLVutils.unpack">
<code class="descclassname">virtualsmartcard.TLVutils.</code><code class="descname">unpack</code><span class="sig-paren">(</span><em>data</em>, <em>with_marks=None</em>, <em>offset=0</em>, <em>include_filler=False</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.TLVutils.unpack" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
&copy; Copyright 2009-2016 by Dominik Oepen and Frank Morgner.<br/>
</p>
</div>
</footer>
</body>
</html>

View File

@@ -0,0 +1,389 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>VirtualSmartcard Module &mdash; vsmartcard 2016-10-10 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: '2016-10-10',
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 2016-10-10 documentation" href="../../index.html" />
<link rel="up" title="virtualsmartcard Package" href="virtualsmartcard.html" />
<link rel="next" title="utils Module" href="virtualsmartcard.utils.html" />
<link rel="prev" title="TLVutils Module" href="virtualsmartcard.TLVutils.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 role="document">
<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>
<li class="toctree-l1"><a class="reference internal" href="../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"><a class="reference internal" href="../../ACardEmulator/README.html">Android 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="../../npa/README.html">nPA Smart Card Library</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../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="#">VirtualSmartcard Module</a></li>
</ul>
</ul>
</li>
<li>
<a href="virtualsmartcard.TLVutils.html" title="Previous Chapter: TLVutils Module"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; TLVutils Module</span>
</a>
</li>
<li>
<a href="virtualsmartcard.utils.html" title="Next Chapter: utils Module"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">utils Module &raquo;</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="virtualsmartcard-module">
<h1>VirtualSmartcard Module<a class="headerlink" href="#virtualsmartcard-module" title="Permalink to this headline"></a></h1>
<p class="graphviz">
<img src="../../_images/inheritance-66308f7843803aa5084df2fbf62c13b8b1f3a5d4.png" alt="Inheritance diagram of virtualsmartcard.VirtualSmartcard" usemap="#inheritance4bd50c7c14" class="inheritance"/>
<map id="inheritance4bd50c7c14" name="inheritance4bd50c7c14">
<area shape="rect" id="node1" href="#virtualsmartcard.VirtualSmartcard.Iso7816OS" title="virtualsmartcard.VirtualSmartcard.Iso7816OS" alt="" coords="383,55,695,80"/>
<area shape="rect" id="node2" href="#virtualsmartcard.VirtualSmartcard.SmartcardOS" title="Base class for a smart card OS" alt="" coords="5,55,335,80"/>
<area shape="rect" id="node3" href="#virtualsmartcard.VirtualSmartcard.VirtualICC" title="This class is responsible for maintaining the communication of the virtual" alt="" coords="17,5,323,31"/>
</map>
</p>
<span class="target" id="module-virtualsmartcard.VirtualSmartcard"></span><dl class="class">
<dt id="virtualsmartcard.VirtualSmartcard.Iso7816OS">
<em class="property">class </em><code class="descclassname">virtualsmartcard.VirtualSmartcard.</code><code class="descname">Iso7816OS</code><span class="sig-paren">(</span><em>mf</em>, <em>sam</em>, <em>ins2handler=None</em>, <em>extended_length=False</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.Iso7816OS" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#virtualsmartcard.VirtualSmartcard.SmartcardOS" title="virtualsmartcard.VirtualSmartcard.SmartcardOS"><code class="xref py py-class docutils literal"><span class="pre">virtualsmartcard.VirtualSmartcard.SmartcardOS</span></code></a></p>
<dl class="attribute">
<dt id="virtualsmartcard.VirtualSmartcard.Iso7816OS.SAM">
<code class="descname">SAM</code><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.Iso7816OS.SAM" title="Permalink to this definition"></a></dt>
<dd><p>secure access module</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.VirtualSmartcard.Iso7816OS.execute">
<code class="descname">execute</code><span class="sig-paren">(</span><em>msg</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.Iso7816OS.execute" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.VirtualSmartcard.Iso7816OS.formatResult">
<code class="descname">formatResult</code><span class="sig-paren">(</span><em>seekable</em>, <em>le</em>, <em>data</em>, <em>sw</em>, <em>sm</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.Iso7816OS.formatResult" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.VirtualSmartcard.Iso7816OS.getATR">
<code class="descname">getATR</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.Iso7816OS.getATR" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.VirtualSmartcard.Iso7816OS.getResponse">
<code class="descname">getResponse</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.Iso7816OS.getResponse" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="staticmethod">
<dt id="virtualsmartcard.VirtualSmartcard.Iso7816OS.makeATR">
<em class="property">static </em><code class="descname">makeATR</code><span class="sig-paren">(</span><em>**args</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.Iso7816OS.makeATR" title="Permalink to this definition"></a></dt>
<dd><p>Calculate Answer to Reset (ATR) and returns the bitstring.</p>
<blockquote>
<div><ul>
<li><dl class="first docutils">
<dt>directConvention (bool): Whether to use direct convention or</dt>
<dd><p class="first last">inverse convention.</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>TAi, TBi, TCi (optional): Value between 0 and 0xff. Interface</dt>
<dd><p class="first last">Characters (for meaning see ISO 7816-3). Note that
if no transmission protocol is given, it is
automatically selected with T=max{j-1|TAj in args
OR TBj in args OR TCj in args}.</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>T (optional): Value between 0 and 15. Transmission Protocol.</dt>
<dd><p class="first last">Note that if T is set, TAi/TBi/TCi for i&gt;T are
omitted.</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>histChars (optional): Bitstring with 0 &lt;= len(histChars) &lt;= 15.</dt>
<dd><p class="first last">Historical Characters T1 to T15 (for
meaning see ISO 7816-4).</p>
</dd>
</dl>
</li>
</ul>
</div></blockquote>
<p>T0, TDi and TCK are automatically calculated.</p>
</dd></dl>
<dl class="staticmethod">
<dt id="virtualsmartcard.VirtualSmartcard.Iso7816OS.makeThirdSoftwareFunctionTable">
<em class="property">static </em><code class="descname">makeThirdSoftwareFunctionTable</code><span class="sig-paren">(</span><em>commandChainging=False</em>, <em>extendedLe=False</em>, <em>assignLogicalChannel=0</em>, <em>maximumChannels=0</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.Iso7816OS.makeThirdSoftwareFunctionTable" title="Permalink to this definition"></a></dt>
<dd><p>Returns a byte according to the third software function table from the
historical bytes of the card capabilities.</p>
</dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.VirtualSmartcard.Iso7816OS.mf">
<code class="descname">mf</code><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.Iso7816OS.mf" title="Permalink to this definition"></a></dt>
<dd><p>master file</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.VirtualSmartcard.Iso7816OS.powerDown">
<code class="descname">powerDown</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.Iso7816OS.powerDown" title="Permalink to this definition"></a></dt>
<dd><p>Powers down the card</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.VirtualSmartcard.Iso7816OS.powerUp">
<code class="descname">powerUp</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.Iso7816OS.powerUp" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.VirtualSmartcard.Iso7816OS.reset">
<code class="descname">reset</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.Iso7816OS.reset" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="staticmethod">
<dt id="virtualsmartcard.VirtualSmartcard.Iso7816OS.seekable">
<em class="property">static </em><code class="descname">seekable</code><span class="sig-paren">(</span><em>ins</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.Iso7816OS.seekable" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="virtualsmartcard.VirtualSmartcard.SmartcardOS">
<em class="property">class </em><code class="descclassname">virtualsmartcard.VirtualSmartcard.</code><code class="descname">SmartcardOS</code><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.SmartcardOS" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Base class for a smart card OS</p>
<dl class="method">
<dt id="virtualsmartcard.VirtualSmartcard.SmartcardOS.execute">
<code class="descname">execute</code><span class="sig-paren">(</span><em>msg</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.SmartcardOS.execute" title="Permalink to this definition"></a></dt>
<dd><p>Returns response to the given APDU as string of characters</p>
<table class="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">Parameters:</th><td class="field-body"><strong>msg</strong> &#8211; the APDU as string of characters</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.VirtualSmartcard.SmartcardOS.getATR">
<code class="descname">getATR</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.SmartcardOS.getATR" title="Permalink to this definition"></a></dt>
<dd><p>Returns the ATR of the card as string of characters</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.VirtualSmartcard.SmartcardOS.powerDown">
<code class="descname">powerDown</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.SmartcardOS.powerDown" title="Permalink to this definition"></a></dt>
<dd><p>Powers down the card</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.VirtualSmartcard.SmartcardOS.powerUp">
<code class="descname">powerUp</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.SmartcardOS.powerUp" title="Permalink to this definition"></a></dt>
<dd><p>Powers up the card</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.VirtualSmartcard.SmartcardOS.reset">
<code class="descname">reset</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.SmartcardOS.reset" title="Permalink to this definition"></a></dt>
<dd><p>Performs a warm reset of the card (no power down)</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="virtualsmartcard.VirtualSmartcard.VirtualICC">
<em class="property">class </em><code class="descclassname">virtualsmartcard.VirtualSmartcard.</code><code class="descname">VirtualICC</code><span class="sig-paren">(</span><em>datasetfile</em>, <em>card_type</em>, <em>host</em>, <em>port</em>, <em>readernum=None</em>, <em>ef_cardsecurity=None</em>, <em>ef_cardaccess=None</em>, <em>ca_key=None</em>, <em>cvca=None</em>, <em>disable_checks=False</em>, <em>esign_key=None</em>, <em>esign_ca_cert=None</em>, <em>esign_cert=None</em>, <em>logginglevel=20</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.VirtualICC" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>This class is responsible for maintaining the communication of the virtual
PCD and the emulated smartcard. vpicc and vpcd communicate via a socket.
The vpcd sends command APDUs (which it receives from an application) to the
vicc. The vicc passes these CAPDUs on to an emulated smartcard, which
produces a response APDU. This RAPDU is then passed back by the vicc to
the vpcd, which forwards it to the application.</p>
<dl class="method">
<dt id="virtualsmartcard.VirtualSmartcard.VirtualICC._VirtualICC__recvFromVPICC">
<code class="descname">_VirtualICC__recvFromVPICC</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.VirtualICC._VirtualICC__recvFromVPICC" title="Permalink to this definition"></a></dt>
<dd><p>Receive a message from the vpcd</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.VirtualSmartcard.VirtualICC._VirtualICC__sendToVPICC">
<code class="descname">_VirtualICC__sendToVPICC</code><span class="sig-paren">(</span><em>msg</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.VirtualICC._VirtualICC__sendToVPICC" title="Permalink to this definition"></a></dt>
<dd><p>Send a message to the vpcd</p>
</dd></dl>
<dl class="staticmethod">
<dt id="virtualsmartcard.VirtualSmartcard.VirtualICC.connectToPort">
<em class="property">static </em><code class="descname">connectToPort</code><span class="sig-paren">(</span><em>host</em>, <em>port</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.VirtualICC.connectToPort" title="Permalink to this definition"></a></dt>
<dd><p>Open a connection to a given host on a given port.</p>
</dd></dl>
<dl class="staticmethod">
<dt id="virtualsmartcard.VirtualSmartcard.VirtualICC.openPort">
<em class="property">static </em><code class="descname">openPort</code><span class="sig-paren">(</span><em>port</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.VirtualICC.openPort" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.VirtualSmartcard.VirtualICC.run">
<code class="descname">run</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.VirtualICC.run" title="Permalink to this definition"></a></dt>
<dd><p>Main loop of the vpicc. Receives command APDUs via a socket from the
vpcd, dispatches them to the emulated smartcard and sends the resulting
respsonse APDU back to the vpcd.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.VirtualSmartcard.VirtualICC.signalHandler">
<code class="descname">signalHandler</code><span class="sig-paren">(</span><em>sig=None</em>, <em>frame=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.VirtualICC.signalHandler" title="Permalink to this definition"></a></dt>
<dd><p>Basically this signal handler just surpresses a traceback from being
printed when the user presses crtl-c</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.VirtualSmartcard.VirtualICC.stop">
<code class="descname">stop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.VirtualSmartcard.VirtualICC.stop" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
&copy; Copyright 2009-2016 by Dominik Oepen and Frank Morgner.<br/>
</p>
</div>
</footer>
</body>
</html>

View File

@@ -0,0 +1,224 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>HandlerTest Module &mdash; vsmartcard 2016-10-10 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: '2016-10-10',
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 2016-10-10 documentation" href="../../index.html" />
<link rel="up" title="cards Package" href="virtualsmartcard.cards.html" />
<link rel="next" title="Relay Module" href="virtualsmartcard.cards.Relay.html" />
<link rel="prev" title="cards Package" href="virtualsmartcard.cards.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 role="document">
<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>
<li class="toctree-l1"><a class="reference internal" href="../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"><a class="reference internal" href="../../ACardEmulator/README.html">Android 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="../../npa/README.html">nPA Smart Card Library</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../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="#">HandlerTest Module</a></li>
</ul>
</ul>
</li>
<li>
<a href="virtualsmartcard.cards.html" title="Previous Chapter: cards Package"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; cards Package</span>
</a>
</li>
<li>
<a href="virtualsmartcard.cards.Relay.html" title="Next Chapter: Relay Module"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">Relay Module &raquo;</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="handlertest-module">
<h1>HandlerTest Module<a class="headerlink" href="#handlertest-module" title="Permalink to this headline"></a></h1>
<p class="graphviz">
<img src="../../_images/inheritance-87c02cb0f500902e28e2583f9a1dc09e571332ee.png" alt="Inheritance diagram of virtualsmartcard.cards.HandlerTest" usemap="#inheritancee548df9983" class="inheritance"/>
<map id="inheritancee548df9983" name="inheritancee548df9983">
<area shape="rect" id="node1" href="virtualsmartcard.VirtualSmartcard.html#virtualsmartcard.VirtualSmartcard.SmartcardOS" title="Base class for a smart card OS" alt="" coords="5,5,335,31"/>
<area shape="rect" id="node2" href="#virtualsmartcard.cards.HandlerTest.HandlerTestOS" title="This class implements the commands used for the PC/SC&#45;lite &#160;smart &#160;card" alt="" coords="383,5,725,31"/>
</map>
</p>
<span class="target" id="module-virtualsmartcard.cards.HandlerTest"></span><dl class="class">
<dt id="virtualsmartcard.cards.HandlerTest.HandlerTestOS">
<em class="property">class </em><code class="descclassname">virtualsmartcard.cards.HandlerTest.</code><code class="descname">HandlerTestOS</code><a class="headerlink" href="#virtualsmartcard.cards.HandlerTest.HandlerTestOS" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="virtualsmartcard.VirtualSmartcard.html#virtualsmartcard.VirtualSmartcard.SmartcardOS" title="virtualsmartcard.VirtualSmartcard.SmartcardOS"><code class="xref py py-class docutils literal"><span class="pre">virtualsmartcard.VirtualSmartcard.SmartcardOS</span></code></a></p>
<p>This class implements the commands used for the PC/SC-lite smart card
reader driver tester. See <a class="reference external" href="http://pcsclite.alioth.debian.org/pcsclite.html">http://pcsclite.alioth.debian.org/pcsclite.html</a>
and handler_test(1).</p>
<dl class="method">
<dt id="virtualsmartcard.cards.HandlerTest.HandlerTestOS._HandlerTestOS__output_from_le">
<code class="descname">_HandlerTestOS__output_from_le</code><span class="sig-paren">(</span><em>msg</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.HandlerTest.HandlerTestOS._HandlerTestOS__output_from_le" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.HandlerTest.HandlerTestOS.execute">
<code class="descname">execute</code><span class="sig-paren">(</span><em>msg</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.HandlerTest.HandlerTestOS.execute" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.HandlerTest.HandlerTestOS.getATR">
<code class="descname">getATR</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.HandlerTest.HandlerTestOS.getATR" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.HandlerTest.HandlerTestOS.powerDown">
<code class="descname">powerDown</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.HandlerTest.HandlerTestOS.powerDown" title="Permalink to this definition"></a></dt>
<dd><p>Powers down the card</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.HandlerTest.HandlerTestOS.powerUp">
<code class="descname">powerUp</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.HandlerTest.HandlerTestOS.powerUp" title="Permalink to this definition"></a></dt>
<dd><p>Powers up the card</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.HandlerTest.HandlerTestOS.reset">
<code class="descname">reset</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.HandlerTest.HandlerTestOS.reset" title="Permalink to this definition"></a></dt>
<dd><p>Performs a warm reset of the card (no power down)</p>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
&copy; Copyright 2009-2016 by Dominik Oepen and Frank Morgner.<br/>
</p>
</div>
</footer>
</body>
</html>

View File

@@ -0,0 +1,223 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Relay Module &mdash; vsmartcard 2016-10-10 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: '2016-10-10',
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 2016-10-10 documentation" href="../../index.html" />
<link rel="up" title="cards Package" href="virtualsmartcard.cards.html" />
<link rel="next" title="cryptoflex Module" href="virtualsmartcard.cards.cryptoflex.html" />
<link rel="prev" title="HandlerTest Module" href="virtualsmartcard.cards.HandlerTest.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 role="document">
<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>
<li class="toctree-l1"><a class="reference internal" href="../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"><a class="reference internal" href="../../ACardEmulator/README.html">Android 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="../../npa/README.html">nPA Smart Card Library</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../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="#">Relay Module</a></li>
</ul>
</ul>
</li>
<li>
<a href="virtualsmartcard.cards.HandlerTest.html" title="Previous Chapter: HandlerTest Module"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; HandlerTest Modu...</span>
</a>
</li>
<li>
<a href="virtualsmartcard.cards.cryptoflex.html" title="Next Chapter: cryptoflex Module"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">cryptoflex Modul... &raquo;</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="relay-module">
<h1>Relay Module<a class="headerlink" href="#relay-module" title="Permalink to this headline"></a></h1>
<p class="graphviz">
<img src="../../_images/inheritance-d5ba565391cc5041a7ec6184d1e94238defbb78e.png" alt="Inheritance diagram of virtualsmartcard.cards.Relay" usemap="#inheritanceeed1b727ec" class="inheritance"/>
<map id="inheritanceeed1b727ec" name="inheritanceeed1b727ec">
<area shape="rect" id="node1" href="virtualsmartcard.VirtualSmartcard.html#virtualsmartcard.VirtualSmartcard.SmartcardOS" title="Base class for a smart card OS" alt="" coords="5,5,335,31"/>
<area shape="rect" id="node2" href="#virtualsmartcard.cards.Relay.RelayOS" title="This class implements relaying of a (physical) smartcard. The RelayOS" alt="" coords="383,5,644,31"/>
</map>
</p>
<span class="target" id="module-virtualsmartcard.cards.Relay"></span><dl class="class">
<dt id="virtualsmartcard.cards.Relay.RelayOS">
<em class="property">class </em><code class="descclassname">virtualsmartcard.cards.Relay.</code><code class="descname">RelayOS</code><span class="sig-paren">(</span><em>readernum</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.Relay.RelayOS" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="virtualsmartcard.VirtualSmartcard.html#virtualsmartcard.VirtualSmartcard.SmartcardOS" title="virtualsmartcard.VirtualSmartcard.SmartcardOS"><code class="xref py py-class docutils literal"><span class="pre">virtualsmartcard.VirtualSmartcard.SmartcardOS</span></code></a></p>
<p>This class implements relaying of a (physical) smartcard. The RelayOS
forwards the command APDUs received from the vpcd to the real smartcard via
an actual smart card reader and sends the responses back to the vpcd.
This class can be used to implement relay or MitM attacks.</p>
<dl class="method">
<dt id="virtualsmartcard.cards.Relay.RelayOS.cleanup">
<code class="descname">cleanup</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.Relay.RelayOS.cleanup" title="Permalink to this definition"></a></dt>
<dd><p>Close the connection to the physical card</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.Relay.RelayOS.execute">
<code class="descname">execute</code><span class="sig-paren">(</span><em>msg</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.Relay.RelayOS.execute" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.Relay.RelayOS.getATR">
<code class="descname">getATR</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.Relay.RelayOS.getATR" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.Relay.RelayOS.powerDown">
<code class="descname">powerDown</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.Relay.RelayOS.powerDown" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.Relay.RelayOS.powerUp">
<code class="descname">powerUp</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.Relay.RelayOS.powerUp" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.Relay.RelayOS.reset">
<code class="descname">reset</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.Relay.RelayOS.reset" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
&copy; Copyright 2009-2016 by Dominik Oepen and Frank Morgner.<br/>
</p>
</div>
</footer>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,890 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ePass Module &mdash; vsmartcard 2016-10-10 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: '2016-10-10',
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 2016-10-10 documentation" href="../../index.html" />
<link rel="up" title="cards Package" href="virtualsmartcard.cards.html" />
<link rel="next" title="nPA Module" href="virtualsmartcard.cards.nPA.html" />
<link rel="prev" title="cryptoflex Module" href="virtualsmartcard.cards.cryptoflex.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 role="document">
<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>
<li class="toctree-l1"><a class="reference internal" href="../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"><a class="reference internal" href="../../ACardEmulator/README.html">Android 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="../../npa/README.html">nPA Smart Card Library</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../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="#">ePass Module</a></li>
</ul>
</ul>
</li>
<li>
<a href="virtualsmartcard.cards.cryptoflex.html" title="Previous Chapter: cryptoflex Module"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; cryptoflex Modul...</span>
</a>
</li>
<li>
<a href="virtualsmartcard.cards.nPA.html" title="Next Chapter: nPA Module"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">nPA Module &raquo;</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="epass-module">
<h1>ePass Module<a class="headerlink" href="#epass-module" title="Permalink to this headline"></a></h1>
<p class="graphviz">
<img src="../../_images/inheritance-4ccf04ec0e92318a21cb6d3d419a82fcf6101d07.png" alt="Inheritance diagram of virtualsmartcard.cards.ePass" usemap="#inheritancef880455e0d" class="inheritance"/>
<map id="inheritancef880455e0d" name="inheritancef880455e0d">
<area shape="rect" id="node1" href="virtualsmartcard.SEutils.html#virtualsmartcard.SEutils.Security_Environment" title="virtualsmartcard.SEutils.Security_Environment" alt="" coords="5,55,324,80"/>
<area shape="rect" id="node4" href="#virtualsmartcard.cards.ePass.ePass_SE" title="This class implements the Security Environment of the ICAO Passports. It" alt="" coords="383,55,655,80"/>
<area shape="rect" id="node2" href="virtualsmartcard.SmartcardSAM.html#virtualsmartcard.SmartcardSAM.SAM" title="This class is used to store the data needed by the SAM." alt="" coords="36,5,293,31"/>
<area shape="rect" id="node3" href="#virtualsmartcard.cards.ePass.PassportSAM" title="SAM for ICAO ePassport. Implements Basic access control and key derivation" alt="" coords="372,5,667,31"/>
</map>
</p>
<span class="target" id="module-virtualsmartcard.cards.ePass"></span><dl class="class">
<dt id="virtualsmartcard.cards.ePass.PassportSAM">
<em class="property">class </em><code class="descclassname">virtualsmartcard.cards.ePass.</code><code class="descname">PassportSAM</code><span class="sig-paren">(</span><em>mf</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.PassportSAM" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="virtualsmartcard.SmartcardSAM.html#virtualsmartcard.SmartcardSAM.SAM" title="virtualsmartcard.SmartcardSAM.SAM"><code class="xref py py-class docutils literal"><span class="pre">virtualsmartcard.SmartcardSAM.SAM</span></code></a></p>
<p>SAM for ICAO ePassport. Implements Basic access control and key derivation
for Secure Messaging.</p>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.PassportSAM.FSdecrypt">
<code class="descname">FSdecrypt</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.PassportSAM.FSdecrypt" title="Permalink to this definition"></a></dt>
<dd><p>Decrypt the given data, using the parameters stored in the SAM.
Right now we do not encrypt the data. In memory encryption might or
might not be added in a future version.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.PassportSAM.FSencrypt">
<code class="descname">FSencrypt</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.PassportSAM.FSencrypt" title="Permalink to this definition"></a></dt>
<dd><p>Encrypt the given data, using the parameters stored in the SAM.
Right now we do not encrypt the data. In memory encryption might or
might not be added in a future version.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.PassportSAM._PassportSAM__computeKeys">
<code class="descname">_PassportSAM__computeKeys</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.PassportSAM._PassportSAM__computeKeys" title="Permalink to this definition"></a></dt>
<dd><p>Computes the keys depending on the machine readable
zone of the passport according to TR-PKI mrtds ICC read-only
access v1.1 annex E.1.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.PassportSAM._get_referenced_key">
<code class="descname">_get_referenced_key</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.PassportSAM._get_referenced_key" title="Permalink to this definition"></a></dt>
<dd><p>This method returns the key specified by the p2 parameter. The key may
be stored on the cards filesystem.</p>
<table class="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">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>p1</strong> &#8211; Specifies the algorithm to use.</li>
<li><strong>p2</strong> &#8211; <p>Specifies a reference to the key to be used for encryption.</p>
<table border="1" class="docutils">
<colgroup>
<col width="3%" />
<col width="3%" />
<col width="3%" />
<col width="3%" />
<col width="3%" />
<col width="3%" />
<col width="3%" />
<col width="3%" />
<col width="73%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">b8</th>
<th class="head">b7</th>
<th class="head">b6</th>
<th class="head">b5</th>
<th class="head">b4</th>
<th class="head">b3</th>
<th class="head">b2</th>
<th class="head">b1</th>
<th class="head">Meaning</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>No information is given</td>
</tr>
<tr class="row-odd"><td>0</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td>Global reference data(e.g. MF specific key)</td>
</tr>
<tr class="row-even"><td>1</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td>Specific reference data(e.g. DF specific
key)</td>
</tr>
<tr class="row-odd"><td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td><ul class="first last">
<li></li>
</ul>
</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>Number of the secret</td>
</tr>
</tbody>
</table>
<p>Any other value RFU</p>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.PassportSAM.change_reference_data">
<code class="descname">change_reference_data</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.PassportSAM.change_reference_data" title="Permalink to this definition"></a></dt>
<dd><p>Change the specified referenced data (e.g. CHV) of the card</p>
</dd></dl>
<dl class="staticmethod">
<dt id="virtualsmartcard.cards.ePass.PassportSAM.derive_key">
<em class="property">static </em><code class="descname">derive_key</code><span class="sig-paren">(</span><em>seed</em>, <em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.PassportSAM.derive_key" title="Permalink to this definition"></a></dt>
<dd><p>Derive a key according to TR-PKI mrtds ICC read-only access v1.1
annex E.1.
c is either 1 for encryption or 2 for MAC computation.
Returns: Ka + Kb
Note: Does not adjust parity. Nobody uses that anyway ...</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.PassportSAM.erase_SE">
<code class="descname">erase_SE</code><span class="sig-paren">(</span><em>SEID</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.PassportSAM.erase_SE" title="Permalink to this definition"></a></dt>
<dd><p>Erases a Security Environment stored under SEID from the SAM</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.PassportSAM.external_authenticate">
<code class="descname">external_authenticate</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>resp_data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.PassportSAM.external_authenticate" title="Permalink to this definition"></a></dt>
<dd><p>Performs the basic access control protocol as defined in
the ICAO MRTD standard</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.PassportSAM.generate_public_key_pair">
<code class="descname">generate_public_key_pair</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.PassportSAM.generate_public_key_pair" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.PassportSAM.get_card_number">
<code class="descname">get_card_number</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.PassportSAM.get_card_number" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.PassportSAM.get_challenge">
<code class="descname">get_challenge</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.PassportSAM.get_challenge" title="Permalink to this definition"></a></dt>
<dd><p>Generate a random number of maximum 8 Byte and return it.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.PassportSAM.internal_authenticate">
<code class="descname">internal_authenticate</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.PassportSAM.internal_authenticate" title="Permalink to this definition"></a></dt>
<dd><p>Authenticate card to terminal. Encrypt the challenge of the terminal
to prove key posession</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.PassportSAM.manage_security_environment">
<code class="descname">manage_security_environment</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.PassportSAM.manage_security_environment" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.PassportSAM.mutual_authenticate">
<code class="descname">mutual_authenticate</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>mutual_challenge</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.PassportSAM.mutual_authenticate" title="Permalink to this definition"></a></dt>
<dd><p>Takes an encrypted challenge in the form
&#8216;Terminal Challenge | Card Challenge | Card number&#8217;
and checks it for validity. If the challenge is successful
the card encrypts &#8216;Card Challenge | Terminal challenge&#8217; and
returns this value</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.PassportSAM.parse_SM_CAPDU">
<code class="descname">parse_SM_CAPDU</code><span class="sig-paren">(</span><em>CAPDU</em>, <em>header_authentication</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.PassportSAM.parse_SM_CAPDU" title="Permalink to this definition"></a></dt>
<dd><p>Parse a command APDU protected by Secure Messaging and return the
unprotected command APDU</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.PassportSAM.perform_security_operation">
<code class="descname">perform_security_operation</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.PassportSAM.perform_security_operation" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.PassportSAM.protect_result">
<code class="descname">protect_result</code><span class="sig-paren">(</span><em>sw</em>, <em>unprotected_result</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.PassportSAM.protect_result" title="Permalink to this definition"></a></dt>
<dd><p>Protect a plain response APDU by Secure Messaging</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.PassportSAM.restore_SE">
<code class="descname">restore_SE</code><span class="sig-paren">(</span><em>SEID</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.PassportSAM.restore_SE" title="Permalink to this definition"></a></dt>
<dd><p>Restores a Security Environment from the SAM and replaces the current
SE with it.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.PassportSAM.set_MF">
<code class="descname">set_MF</code><span class="sig-paren">(</span><em>mf</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.PassportSAM.set_MF" title="Permalink to this definition"></a></dt>
<dd><p>Setter function for the internal reference to the Filesystem. The SAM
needs a reference to the filesystem in order to store/retrieve keys.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.PassportSAM.set_asym_algorithm">
<code class="descname">set_asym_algorithm</code><span class="sig-paren">(</span><em>cipher</em>, <em>keytype</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.PassportSAM.set_asym_algorithm" title="Permalink to this definition"></a></dt>
<dd><table class="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">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>cipher</strong> &#8211; Public/private key object from used for encryption</li>
<li><strong>keytype</strong> &#8211; Type of the public key (e.g. RSA, DSA)</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.PassportSAM.store_SE">
<code class="descname">store_SE</code><span class="sig-paren">(</span><em>SEID</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.PassportSAM.store_SE" title="Permalink to this definition"></a></dt>
<dd><p>Stores the current Security environment in the secure access module.
The SEID is used as a reference to identify the SE.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.PassportSAM.verify">
<code class="descname">verify</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>PIN</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.PassportSAM.verify" title="Permalink to this definition"></a></dt>
<dd><p>Authenticate the card user. Check if he entered a valid PIN.
If the PIN is invalid decrement retry counter. If retry counter
equals zero, block the card until reset with correct PUK</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="virtualsmartcard.cards.ePass.ePass_SE">
<em class="property">class </em><code class="descclassname">virtualsmartcard.cards.ePass.</code><code class="descname">ePass_SE</code><span class="sig-paren">(</span><em>MF</em>, <em>SAM</em>, <em>ssc=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.ePass_SE" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="virtualsmartcard.SEutils.html#virtualsmartcard.SEutils.Security_Environment" title="virtualsmartcard.SEutils.Security_Environment"><code class="xref py py-class docutils literal"><span class="pre">virtualsmartcard.SEutils.Security_Environment</span></code></a></p>
<p>This class implements the Security Environment of the ICAO Passports. It
is required in order to use the send sequence counter for secure messaging.</p>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.ePass_SE._set_SE">
<code class="descname">_set_SE</code><span class="sig-paren">(</span><em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.ePass_SE._set_SE" title="Permalink to this definition"></a></dt>
<dd><p>Manipulate the current Security Environment. P2 is the tag of a
control reference template, data contains control reference objects</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.ePass_SE.compute_cryptographic_checksum">
<code class="descname">compute_cryptographic_checksum</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.ePass_SE.compute_cryptographic_checksum" title="Permalink to this definition"></a></dt>
<dd><p>Compute a cryptographic checksum (e.g. MAC) for the given data.
The ePass uses a Send Sequence Counter for MAC calculation</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.ePass_SE.compute_digital_signature">
<code class="descname">compute_digital_signature</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.ePass_SE.compute_digital_signature" title="Permalink to this definition"></a></dt>
<dd><p>Compute a digital signature for the given data.
Algorithm and key are specified in the current SE</p>
<table class="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">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>p1</strong> &#8211; Must be 0x9E = Secure Messaging class for digital signatures</li>
<li><strong>p2</strong> &#8211; Must be one of 0x9A, 0xAC, 0xBC. Indicates what kind of data
is included in the data field.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.ePass_SE.decipher">
<code class="descname">decipher</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.ePass_SE.decipher" title="Permalink to this definition"></a></dt>
<dd><p>Decipher data using key, algorithm, IV and Padding specified
by the current Security environment.</p>
<table class="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">Returns:</th><td class="field-body">raw data (no TLV coding). Padding is not removed!!!</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.ePass_SE.encipher">
<code class="descname">encipher</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.ePass_SE.encipher" title="Permalink to this definition"></a></dt>
<dd><p>Encipher data using key, algorithm, IV and Padding specified
by the current Security environment.</p>
<table class="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">Returns:</th><td class="field-body">raw data (no TLV coding).</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.ePass_SE.generate_public_key_pair">
<code class="descname">generate_public_key_pair</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.ePass_SE.generate_public_key_pair" title="Permalink to this definition"></a></dt>
<dd><p>The GENERATE PUBLIC-KEY PAIR command either initiates the generation
and storing of a key pair, i.e., a public key and a private key, in the
card, or accesses a key pair previously generated in the card.</p>
<table class="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">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>p1</strong> &#8211; should be 0x00 (generate new key)</li>
<li><strong>p2</strong> &#8211; &#8216;00&#8217; (no information provided) or reference of the key to
be generated</li>
<li><strong>data</strong> &#8211; One or more CRTs associated to the key generation if
P1-P2 different from &#8216;0000&#8217;</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.ePass_SE.hash">
<code class="descname">hash</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.ePass_SE.hash" title="Permalink to this definition"></a></dt>
<dd><p>Hash the given data using the algorithm specified by the current
Security environment.</p>
<table class="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">Returns:</th><td class="field-body">raw data (no TLV coding).</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.ePass_SE.manage_security_environment">
<code class="descname">manage_security_environment</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.ePass_SE.manage_security_environment" title="Permalink to this definition"></a></dt>
<dd><p>This method is used to store, restore or erase Security Environments
or to manipulate the various parameters of the current SE.
P1 specifies the operation to perform, p2 is either the SEID for the
referred SE or the tag of a control reference template</p>
<table class="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">Parameters:</th><td class="field-body"><strong>p1</strong> &#8211; <p>Bitmask according to this table</p>
<table border="1" class="docutils">
<colgroup>
<col width="4%" />
<col width="4%" />
<col width="4%" />
<col width="4%" />
<col width="4%" />
<col width="4%" />
<col width="4%" />
<col width="4%" />
<col width="71%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">b8</th>
<th class="head">b7</th>
<th class="head">b6</th>
<th class="head">b5</th>
<th class="head">b4</th>
<th class="head">b3</th>
<th class="head">b2</th>
<th class="head">b1</th>
<th class="head">Meaning</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td>1</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td>Secure messaging in command data field</td>
</tr>
<tr class="row-odd"><td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td>1</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td>Secure messaging in response data field</td>
</tr>
<tr class="row-even"><td><ul class="first last simple">
<li></li>
</ul>
</td>
<td>1</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td>Computation, decipherment, internal
authentication and key agreement</td>
</tr>
<tr class="row-odd"><td>1</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td>Verification, encipherment, external
authentication and key agreement</td>
</tr>
<tr class="row-even"><td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>SET</td>
</tr>
<tr class="row-odd"><td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>STORE</td>
</tr>
<tr class="row-even"><td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>RESTORE</td>
</tr>
<tr class="row-odd"><td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>ERASE</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.ePass_SE.parse_SM_CAPDU">
<code class="descname">parse_SM_CAPDU</code><span class="sig-paren">(</span><em>CAPDU</em>, <em>authenticate_header</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.ePass_SE.parse_SM_CAPDU" title="Permalink to this definition"></a></dt>
<dd><p>This methods parses a data field including Secure Messaging objects.
SM_header indicates whether or not the header of the message shall be
authenticated. It returns an unprotected command APDU</p>
<table class="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">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>CAPDU</strong> &#8211; The protected CAPDU to be parsed</li>
<li><strong>authenticate_header</strong> &#8211; Whether or not the header should be
included in authentication mechanisms</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Unprotected command APDU</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.ePass_SE.perform_security_operation">
<code class="descname">perform_security_operation</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.ePass_SE.perform_security_operation" title="Permalink to this definition"></a></dt>
<dd><p>In the end this command is nothing but a big switch for all the other
commands in ISO 7816-8. It will invoke the appropriate command and
return its result</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.ePass_SE.protect_response">
<code class="descname">protect_response</code><span class="sig-paren">(</span><em>sw</em>, <em>result</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.ePass_SE.protect_response" title="Permalink to this definition"></a></dt>
<dd><p>This method protects a response APDU using secure messaging mechanisms</p>
<table class="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">Returns:</th><td class="field-body">the protected data and the SW bytes</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.ePass_SE.verify_certificate">
<code class="descname">verify_certificate</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.ePass_SE.verify_certificate" title="Permalink to this definition"></a></dt>
<dd><p>Verify a certificate send by the terminal using the internal trust
anchors.
This method is currently not implemented.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.ePass_SE.verify_cryptographic_checksum">
<code class="descname">verify_cryptographic_checksum</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.ePass_SE.verify_cryptographic_checksum" title="Permalink to this definition"></a></dt>
<dd><p>Verify the cryptographic checksum contained in the data field.
Data field must contain a cryptographic checksum (tag 0x8E) and a plain
value (tag 0x80)</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.cards.ePass.ePass_SE.verify_digital_signature">
<code class="descname">verify_digital_signature</code><span class="sig-paren">(</span><em>p1</em>, <em>p2</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.ePass.ePass_SE.verify_digital_signature" title="Permalink to this definition"></a></dt>
<dd><p>Verify the digital signature contained in the data field. Data must
contain a data to sign (tag 0x9A, 0xAC or 0xBC) and a digital signature
(0x9E)</p>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
&copy; Copyright 2009-2016 by Dominik Oepen and Frank Morgner.<br/>
</p>
</div>
</footer>
</body>
</html>

View File

@@ -0,0 +1,184 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cards Package &mdash; vsmartcard 2016-10-10 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: '2016-10-10',
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 2016-10-10 documentation" href="../../index.html" />
<link rel="up" title="virtualsmartcard Package" href="virtualsmartcard.html" />
<link rel="next" title="HandlerTest Module" href="virtualsmartcard.cards.HandlerTest.html" />
<link rel="prev" title="virtualsmartcard Package" href="virtualsmartcard.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 role="document">
<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>
<li class="toctree-l1"><a class="reference internal" href="../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"><a class="reference internal" href="../../ACardEmulator/README.html">Android 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="../../npa/README.html">nPA Smart Card Library</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../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="#">cards Package</a></li>
</ul>
</ul>
</li>
<li>
<a href="virtualsmartcard.html" title="Previous Chapter: virtualsmartcard Package"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; virtualsmartcard...</span>
</a>
</li>
<li>
<a href="virtualsmartcard.cards.HandlerTest.html" title="Next Chapter: HandlerTest Module"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">HandlerTest Modu... &raquo;</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="cards-package">
<h1>cards Package<a class="headerlink" href="#cards-package" title="Permalink to this headline"></a></h1>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="virtualsmartcard.cards.HandlerTest.html">HandlerTest Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="virtualsmartcard.cards.Relay.html">Relay Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="virtualsmartcard.cards.cryptoflex.html">cryptoflex Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="virtualsmartcard.cards.ePass.html">ePass Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="virtualsmartcard.cards.nPA.html">nPA Module</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
&copy; Copyright 2009-2016 by Dominik Oepen and Frank Morgner.<br/>
</p>
</div>
</footer>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,204 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>virtualsmartcard Package &mdash; vsmartcard 2016-10-10 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: '2016-10-10',
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 2016-10-10 documentation" href="../../index.html" />
<link rel="up" title="Creating a Virtual Smart Card" href="../api.html" />
<link rel="next" title="cards Package" href="virtualsmartcard.cards.html" />
<link rel="prev" title="Creating a Virtual Smart Card" href="../api.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 role="document">
<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>
<li class="toctree-l1"><a class="reference internal" href="../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"><a class="reference internal" href="../../ACardEmulator/README.html">Android 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="../../npa/README.html">nPA Smart Card Library</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../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="#">virtualsmartcard Package</a></li>
</ul>
</ul>
</li>
<li>
<a href="../api.html" title="Previous Chapter: Creating a Virtual Smart Card"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; Creating a Virtu...</span>
</a>
</li>
<li>
<a href="virtualsmartcard.cards.html" title="Next Chapter: cards Package"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">cards Package &raquo;</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="virtualsmartcard-package">
<h1>virtualsmartcard Package<a class="headerlink" href="#virtualsmartcard-package" title="Permalink to this headline"></a></h1>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="virtualsmartcard.cards.html">cards Package</a><ul>
<li class="toctree-l2"><a class="reference internal" href="virtualsmartcard.cards.HandlerTest.html">HandlerTest Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="virtualsmartcard.cards.Relay.html">Relay Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="virtualsmartcard.cards.cryptoflex.html">cryptoflex Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="virtualsmartcard.cards.ePass.html">ePass Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="virtualsmartcard.cards.nPA.html">nPA Module</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="virtualsmartcard.tests.html">tests Package</a><ul>
<li class="toctree-l2"><a class="reference internal" href="virtualsmartcard.tests.CardGenerator_test.html">CardGenerator_test Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="virtualsmartcard.tests.CryptoUtils_test.html">CryptoUtils_test Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="virtualsmartcard.tests.SmartcardSAM_test.html">SmartcardSAM_test Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="virtualsmartcard.tests.utils_test.html">utils_test Module</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="virtualsmartcard.CardGenerator.html">CardGenerator Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="virtualsmartcard.ConstantDefinitions.html">ConstantDefinitions Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="virtualsmartcard.CryptoUtils.html">CryptoUtils Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="virtualsmartcard.SEutils.html">SEutils Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="virtualsmartcard.SWutils.html">SWutils Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="virtualsmartcard.SmartcardFilesystem.html">SmartcardFilesystem Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="virtualsmartcard.SmartcardSAM.html">SmartcardSAM Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="virtualsmartcard.TLVutils.html">TLVutils Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="virtualsmartcard.VirtualSmartcard.html">VirtualSmartcard Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="virtualsmartcard.utils.html">utils Module</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
&copy; Copyright 2009-2016 by Dominik Oepen and Frank Morgner.<br/>
</p>
</div>
</footer>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,731 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CryptoUtils_test Module &mdash; vsmartcard 2016-10-10 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: '2016-10-10',
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 2016-10-10 documentation" href="../../index.html" />
<link rel="up" title="tests Package" href="virtualsmartcard.tests.html" />
<link rel="next" title="SmartcardSAM_test Module" href="virtualsmartcard.tests.SmartcardSAM_test.html" />
<link rel="prev" title="CardGenerator_test Module" href="virtualsmartcard.tests.CardGenerator_test.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 role="document">
<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>
<li class="toctree-l1"><a class="reference internal" href="../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"><a class="reference internal" href="../../ACardEmulator/README.html">Android 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="../../npa/README.html">nPA Smart Card Library</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../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="#">CryptoUtils_test Module</a></li>
</ul>
</ul>
</li>
<li>
<a href="virtualsmartcard.tests.CardGenerator_test.html" title="Previous Chapter: CardGenerator_test Module"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; CardGenerator_te...</span>
</a>
</li>
<li>
<a href="virtualsmartcard.tests.SmartcardSAM_test.html" title="Next Chapter: SmartcardSAM_test Module"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">SmartcardSAM_tes... &raquo;</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="cryptoutils-test-module">
<h1>CryptoUtils_test Module<a class="headerlink" href="#cryptoutils-test-module" title="Permalink to this headline"></a></h1>
<p class="graphviz">
<img src="../../_images/inheritance-8d7ae2bc5a5efc5bac682034d18967034c43784c.png" alt="Inheritance diagram of virtualsmartcard.tests.CryptoUtils_test" usemap="#inheritance34477d81d3" class="inheritance"/>
<map id="inheritance34477d81d3" name="inheritance34477d81d3">
<area shape="rect" id="node1" title="A class whose instances are single test cases." alt="" coords="5,5,172,31"/>
<area shape="rect" id="node2" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils" title="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils" alt="" coords="220,5,591,31"/>
</map>
</p>
<span class="target" id="module-virtualsmartcard.tests.CryptoUtils_test"></span><dl class="class">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils">
<em class="property">class </em><code class="descclassname">virtualsmartcard.tests.CryptoUtils_test.</code><code class="descname">TestCryptoUtils</code><span class="sig-paren">(</span><em>methodName='runTest'</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">unittest.case.TestCase</span></code></p>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils._addSkip">
<code class="descname">_addSkip</code><span class="sig-paren">(</span><em>result</em>, <em>reason</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils._addSkip" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils._baseAssertEqual">
<code class="descname">_baseAssertEqual</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils._baseAssertEqual" title="Permalink to this definition"></a></dt>
<dd><p>The default assertEqual implementation, not type specific.</p>
</dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils._classSetupFailed">
<code class="descname">_classSetupFailed</code><em class="property"> = False</em><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils._classSetupFailed" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils._deprecate">
<code class="descname">_deprecate</code><span class="sig-paren">(</span><em>original_func</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils._deprecate" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils._diffThreshold">
<code class="descname">_diffThreshold</code><em class="property"> = 65536</em><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils._diffThreshold" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils._formatMessage">
<code class="descname">_formatMessage</code><span class="sig-paren">(</span><em>msg</em>, <em>standardMsg</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils._formatMessage" title="Permalink to this definition"></a></dt>
<dd><p>Honour the longMessage attribute when generating failure messages.
If longMessage is False this means:
* Use only an explicit message if it is provided
* Otherwise use the standard message for the assert</p>
<p>If longMessage is True:
* Use the standard message
* If an explicit message is provided, plus &#8216; : &#8216; and the explicit message</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils._getAssertEqualityFunc">
<code class="descname">_getAssertEqualityFunc</code><span class="sig-paren">(</span><em>first</em>, <em>second</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils._getAssertEqualityFunc" title="Permalink to this definition"></a></dt>
<dd><p>Get a detailed comparison function for the types of the two args.</p>
<p>Returns: A callable accepting (first, second, msg=None) that will
raise a failure exception if first != second with a useful human
readable error message for those types.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils._truncateMessage">
<code class="descname">_truncateMessage</code><span class="sig-paren">(</span><em>message</em>, <em>diff</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils._truncateMessage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.addCleanup">
<code class="descname">addCleanup</code><span class="sig-paren">(</span><em>function</em>, <em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.addCleanup" title="Permalink to this definition"></a></dt>
<dd><p>Add a function, with arguments, to be called when the test is
completed. Functions added are called on a LIFO basis and are
called after tearDown on test failure or success.</p>
<p>Cleanup items are called even if setUp fails (unlike tearDown).</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.addTypeEqualityFunc">
<code class="descname">addTypeEqualityFunc</code><span class="sig-paren">(</span><em>typeobj</em>, <em>function</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.addTypeEqualityFunc" title="Permalink to this definition"></a></dt>
<dd><p>Add a type specific assertEqual style function to compare a type.</p>
<p>This method is for use by TestCase subclasses that need to register
their own type equality functions to provide nicer error messages.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><dl class="first last docutils">
<dt>typeobj: The data type to call this function on when both values</dt>
<dd>are of the same type in assertEqual().</dd>
<dt>function: The callable taking two arguments and an optional</dt>
<dd>msg= argument that raises self.failureException with a
useful error message when the two arguments are not equal.</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertAlmostEqual">
<code class="descname">assertAlmostEqual</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>places=None</em>, <em>msg=None</em>, <em>delta=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertAlmostEqual" title="Permalink to this definition"></a></dt>
<dd><p>Fail if the two objects are unequal as determined by their
difference rounded to the given number of decimal places
(default 7) and comparing to zero, or by comparing that the
between the two objects is more than the given delta.</p>
<p>Note that decimal places (from zero) are usually not the same
as significant digits (measured from the most signficant digit).</p>
<p>If the two objects compare equal then they will automatically
compare almost equal.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertAlmostEquals">
<code class="descname">assertAlmostEquals</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>places=None</em>, <em>msg=None</em>, <em>delta=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertAlmostEquals" title="Permalink to this definition"></a></dt>
<dd><p>Fail if the two objects are unequal as determined by their
difference rounded to the given number of decimal places
(default 7) and comparing to zero, or by comparing that the
between the two objects is more than the given delta.</p>
<p>Note that decimal places (from zero) are usually not the same
as significant digits (measured from the most signficant digit).</p>
<p>If the two objects compare equal then they will automatically
compare almost equal.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertDictContainsSubset">
<code class="descname">assertDictContainsSubset</code><span class="sig-paren">(</span><em>expected</em>, <em>actual</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertDictContainsSubset" title="Permalink to this definition"></a></dt>
<dd><p>Checks whether actual is a superset of expected.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertDictEqual">
<code class="descname">assertDictEqual</code><span class="sig-paren">(</span><em>d1</em>, <em>d2</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertDictEqual" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertEqual">
<code class="descname">assertEqual</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertEqual" title="Permalink to this definition"></a></dt>
<dd><p>Fail if the two objects are unequal as determined by the &#8216;==&#8217;
operator.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertEquals">
<code class="descname">assertEquals</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertEquals" title="Permalink to this definition"></a></dt>
<dd><p>Fail if the two objects are unequal as determined by the &#8216;==&#8217;
operator.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertFalse">
<code class="descname">assertFalse</code><span class="sig-paren">(</span><em>expr</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertFalse" title="Permalink to this definition"></a></dt>
<dd><p>Check that the expression is false.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertGreater">
<code class="descname">assertGreater</code><span class="sig-paren">(</span><em>a</em>, <em>b</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertGreater" title="Permalink to this definition"></a></dt>
<dd><p>Just like self.assertTrue(a &gt; b), but with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertGreaterEqual">
<code class="descname">assertGreaterEqual</code><span class="sig-paren">(</span><em>a</em>, <em>b</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertGreaterEqual" title="Permalink to this definition"></a></dt>
<dd><p>Just like self.assertTrue(a &gt;= b), but with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertIn">
<code class="descname">assertIn</code><span class="sig-paren">(</span><em>member</em>, <em>container</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertIn" title="Permalink to this definition"></a></dt>
<dd><p>Just like self.assertTrue(a in b), but with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertIs">
<code class="descname">assertIs</code><span class="sig-paren">(</span><em>expr1</em>, <em>expr2</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertIs" title="Permalink to this definition"></a></dt>
<dd><p>Just like self.assertTrue(a is b), but with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertIsInstance">
<code class="descname">assertIsInstance</code><span class="sig-paren">(</span><em>obj</em>, <em>cls</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertIsInstance" title="Permalink to this definition"></a></dt>
<dd><p>Same as self.assertTrue(isinstance(obj, cls)), with a nicer
default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertIsNone">
<code class="descname">assertIsNone</code><span class="sig-paren">(</span><em>obj</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertIsNone" title="Permalink to this definition"></a></dt>
<dd><p>Same as self.assertTrue(obj is None), with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertIsNot">
<code class="descname">assertIsNot</code><span class="sig-paren">(</span><em>expr1</em>, <em>expr2</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertIsNot" title="Permalink to this definition"></a></dt>
<dd><p>Just like self.assertTrue(a is not b), but with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertIsNotNone">
<code class="descname">assertIsNotNone</code><span class="sig-paren">(</span><em>obj</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertIsNotNone" title="Permalink to this definition"></a></dt>
<dd><p>Included for symmetry with assertIsNone.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertItemsEqual">
<code class="descname">assertItemsEqual</code><span class="sig-paren">(</span><em>expected_seq</em>, <em>actual_seq</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertItemsEqual" title="Permalink to this definition"></a></dt>
<dd><p>An unordered sequence specific comparison. It asserts that
actual_seq and expected_seq have the same element counts.
Equivalent to:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">Counter</span><span class="p">(</span><span class="nb">iter</span><span class="p">(</span><span class="n">actual_seq</span><span class="p">)),</span>
<span class="n">Counter</span><span class="p">(</span><span class="nb">iter</span><span class="p">(</span><span class="n">expected_seq</span><span class="p">)))</span>
</pre></div>
</div>
<p>Asserts that each element has the same count in both sequences.
Example:</p>
<blockquote>
<div><ul class="simple">
<li>[0, 1, 1] and [1, 0, 1] compare equal.</li>
<li>[0, 0, 1] and [0, 1] compare unequal.</li>
</ul>
</div></blockquote>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertLess">
<code class="descname">assertLess</code><span class="sig-paren">(</span><em>a</em>, <em>b</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertLess" title="Permalink to this definition"></a></dt>
<dd><p>Just like self.assertTrue(a &lt; b), but with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertLessEqual">
<code class="descname">assertLessEqual</code><span class="sig-paren">(</span><em>a</em>, <em>b</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertLessEqual" title="Permalink to this definition"></a></dt>
<dd><p>Just like self.assertTrue(a &lt;= b), but with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertListEqual">
<code class="descname">assertListEqual</code><span class="sig-paren">(</span><em>list1</em>, <em>list2</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertListEqual" title="Permalink to this definition"></a></dt>
<dd><p>A list-specific equality assertion.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><p class="first">list1: The first list to compare.
list2: The second list to compare.
msg: Optional message to use on failure instead of a list of</p>
<blockquote class="last">
<div>differences.</div></blockquote>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertMultiLineEqual">
<code class="descname">assertMultiLineEqual</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertMultiLineEqual" title="Permalink to this definition"></a></dt>
<dd><p>Assert that two multi-line strings are equal.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertNotAlmostEqual">
<code class="descname">assertNotAlmostEqual</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>places=None</em>, <em>msg=None</em>, <em>delta=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertNotAlmostEqual" title="Permalink to this definition"></a></dt>
<dd><p>Fail if the two objects are equal as determined by their
difference rounded to the given number of decimal places
(default 7) and comparing to zero, or by comparing that the
between the two objects is less than the given delta.</p>
<p>Note that decimal places (from zero) are usually not the same
as significant digits (measured from the most signficant digit).</p>
<p>Objects that are equal automatically fail.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertNotAlmostEquals">
<code class="descname">assertNotAlmostEquals</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>places=None</em>, <em>msg=None</em>, <em>delta=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertNotAlmostEquals" title="Permalink to this definition"></a></dt>
<dd><p>Fail if the two objects are equal as determined by their
difference rounded to the given number of decimal places
(default 7) and comparing to zero, or by comparing that the
between the two objects is less than the given delta.</p>
<p>Note that decimal places (from zero) are usually not the same
as significant digits (measured from the most signficant digit).</p>
<p>Objects that are equal automatically fail.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertNotEqual">
<code class="descname">assertNotEqual</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertNotEqual" title="Permalink to this definition"></a></dt>
<dd><p>Fail if the two objects are equal as determined by the &#8216;!=&#8217;
operator.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertNotEquals">
<code class="descname">assertNotEquals</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertNotEquals" title="Permalink to this definition"></a></dt>
<dd><p>Fail if the two objects are equal as determined by the &#8216;!=&#8217;
operator.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertNotIn">
<code class="descname">assertNotIn</code><span class="sig-paren">(</span><em>member</em>, <em>container</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertNotIn" title="Permalink to this definition"></a></dt>
<dd><p>Just like self.assertTrue(a not in b), but with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertNotIsInstance">
<code class="descname">assertNotIsInstance</code><span class="sig-paren">(</span><em>obj</em>, <em>cls</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertNotIsInstance" title="Permalink to this definition"></a></dt>
<dd><p>Included for symmetry with assertIsInstance.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertNotRegexpMatches">
<code class="descname">assertNotRegexpMatches</code><span class="sig-paren">(</span><em>text</em>, <em>unexpected_regexp</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertNotRegexpMatches" title="Permalink to this definition"></a></dt>
<dd><p>Fail the test if the text matches the regular expression.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertRaises">
<code class="descname">assertRaises</code><span class="sig-paren">(</span><em>excClass</em>, <em>callableObj=None</em>, <em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertRaises" title="Permalink to this definition"></a></dt>
<dd><p>Fail unless an exception of class excClass is raised
by callableObj when invoked with arguments args and keyword
arguments kwargs. If a different type of exception is
raised, it will not be caught, and the test case will be
deemed to have suffered an error, exactly as for an
unexpected exception.</p>
<p>If called with callableObj omitted or None, will return a
context object used like this:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">assertRaises</span><span class="p">(</span><span class="n">SomeException</span><span class="p">):</span>
<span class="n">do_something</span><span class="p">()</span>
</pre></div>
</div>
<p>The context manager keeps a reference to the exception as
the &#8216;exception&#8217; attribute. This allows you to inspect the
exception after the assertion:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">assertRaises</span><span class="p">(</span><span class="n">SomeException</span><span class="p">)</span> <span class="k">as</span> <span class="n">cm</span><span class="p">:</span>
<span class="n">do_something</span><span class="p">()</span>
<span class="n">the_exception</span> <span class="o">=</span> <span class="n">cm</span><span class="o">.</span><span class="n">exception</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">the_exception</span><span class="o">.</span><span class="n">error_code</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertRaisesRegexp">
<code class="descname">assertRaisesRegexp</code><span class="sig-paren">(</span><em>expected_exception</em>, <em>expected_regexp</em>, <em>callable_obj=None</em>, <em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertRaisesRegexp" title="Permalink to this definition"></a></dt>
<dd><p>Asserts that the message in a raised exception matches a regexp.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><p class="first">expected_exception: Exception class expected to be raised.
expected_regexp: Regexp (re pattern object or string) expected</p>
<blockquote>
<div>to be found in error message.</div></blockquote>
<p class="last">callable_obj: Function to be called.
args: Extra args.
kwargs: Extra kwargs.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertRegexpMatches">
<code class="descname">assertRegexpMatches</code><span class="sig-paren">(</span><em>text</em>, <em>expected_regexp</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertRegexpMatches" title="Permalink to this definition"></a></dt>
<dd><p>Fail the test unless the text matches the regular expression.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertSequenceEqual">
<code class="descname">assertSequenceEqual</code><span class="sig-paren">(</span><em>seq1</em>, <em>seq2</em>, <em>msg=None</em>, <em>seq_type=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertSequenceEqual" title="Permalink to this definition"></a></dt>
<dd><p>An equality assertion for ordered sequences (like lists and tuples).</p>
<p>For the purposes of this function, a valid ordered sequence type is one
which can be indexed, has a length, and has an equality operator.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><p class="first">seq1: The first sequence to compare.
seq2: The second sequence to compare.
seq_type: The expected datatype of the sequences, or None if no</p>
<blockquote>
<div>datatype should be enforced.</div></blockquote>
<dl class="last docutils">
<dt>msg: Optional message to use on failure instead of a list of</dt>
<dd>differences.</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertSetEqual">
<code class="descname">assertSetEqual</code><span class="sig-paren">(</span><em>set1</em>, <em>set2</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertSetEqual" title="Permalink to this definition"></a></dt>
<dd><p>A set-specific equality assertion.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><p class="first">set1: The first set to compare.
set2: The second set to compare.
msg: Optional message to use on failure instead of a list of</p>
<blockquote class="last">
<div>differences.</div></blockquote>
</dd>
</dl>
<p>assertSetEqual uses ducktyping to support different types of sets, and
is optimized for sets specifically (parameters must support a
difference method).</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertTrue">
<code class="descname">assertTrue</code><span class="sig-paren">(</span><em>expr</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertTrue" title="Permalink to this definition"></a></dt>
<dd><p>Check that the expression is true.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertTupleEqual">
<code class="descname">assertTupleEqual</code><span class="sig-paren">(</span><em>tuple1</em>, <em>tuple2</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assertTupleEqual" title="Permalink to this definition"></a></dt>
<dd><p>A tuple-specific equality assertion.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><p class="first">tuple1: The first tuple to compare.
tuple2: The second tuple to compare.
msg: Optional message to use on failure instead of a list of</p>
<blockquote class="last">
<div>differences.</div></blockquote>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assert_">
<code class="descname">assert_</code><span class="sig-paren">(</span><em>expr</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.assert_" title="Permalink to this definition"></a></dt>
<dd><p>Check that the expression is true.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.countTestCases">
<code class="descname">countTestCases</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.countTestCases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.debug">
<code class="descname">debug</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.debug" title="Permalink to this definition"></a></dt>
<dd><p>Run the test without collecting errors in a TestResult</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.defaultTestResult">
<code class="descname">defaultTestResult</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.defaultTestResult" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.doCleanups">
<code class="descname">doCleanups</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.doCleanups" title="Permalink to this definition"></a></dt>
<dd><p>Execute all cleanup functions. Normally called for you after
tearDown.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.fail">
<code class="descname">fail</code><span class="sig-paren">(</span><em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.fail" title="Permalink to this definition"></a></dt>
<dd><p>Fail immediately, with the given message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.failIf">
<code class="descname">failIf</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.failIf" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.failIfAlmostEqual">
<code class="descname">failIfAlmostEqual</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.failIfAlmostEqual" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.failIfEqual">
<code class="descname">failIfEqual</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.failIfEqual" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.failUnless">
<code class="descname">failUnless</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.failUnless" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.failUnlessAlmostEqual">
<code class="descname">failUnlessAlmostEqual</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.failUnlessAlmostEqual" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.failUnlessEqual">
<code class="descname">failUnlessEqual</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.failUnlessEqual" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.failUnlessRaises">
<code class="descname">failUnlessRaises</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.failUnlessRaises" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.failureException">
<code class="descname">failureException</code><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.failureException" title="Permalink to this definition"></a></dt>
<dd><p>alias of <code class="xref py py-class docutils literal"><span class="pre">AssertionError</span></code></p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.id">
<code class="descname">id</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.id" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.longMessage">
<code class="descname">longMessage</code><em class="property"> = False</em><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.longMessage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.maxDiff">
<code class="descname">maxDiff</code><em class="property"> = 640</em><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.maxDiff" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.run">
<code class="descname">run</code><span class="sig-paren">(</span><em>result=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.run" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.setUp">
<code class="descname">setUp</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.setUp" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.setUpClass">
<code class="descname">setUpClass</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.setUpClass" title="Permalink to this definition"></a></dt>
<dd><p>Hook method for setting up class fixture before running tests in the class.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.shortDescription">
<code class="descname">shortDescription</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.shortDescription" title="Permalink to this definition"></a></dt>
<dd><p>Returns a one-line description of the test, or None if no
description has been provided.</p>
<p>The default implementation of this method returns the first line of
the specified test method&#8217;s docstring.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.skipTest">
<code class="descname">skipTest</code><span class="sig-paren">(</span><em>reason</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.skipTest" title="Permalink to this definition"></a></dt>
<dd><p>Skip this test.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.tearDown">
<code class="descname">tearDown</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.tearDown" title="Permalink to this definition"></a></dt>
<dd><p>Hook method for deconstructing the test fixture after testing it.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.tearDownClass">
<code class="descname">tearDownClass</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.tearDownClass" title="Permalink to this definition"></a></dt>
<dd><p>Hook method for deconstructing the class fixture after running all tests in the class.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.test_padding">
<code class="descname">test_padding</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.CryptoUtils_test.TestCryptoUtils.test_padding" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
&copy; Copyright 2009-2016 by Dominik Oepen and Frank Morgner.<br/>
</p>
</div>
</footer>
</body>
</html>

View File

@@ -0,0 +1,751 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SmartcardSAM_test Module &mdash; vsmartcard 2016-10-10 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: '2016-10-10',
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 2016-10-10 documentation" href="../../index.html" />
<link rel="up" title="tests Package" href="virtualsmartcard.tests.html" />
<link rel="next" title="utils_test Module" href="virtualsmartcard.tests.utils_test.html" />
<link rel="prev" title="CryptoUtils_test Module" href="virtualsmartcard.tests.CryptoUtils_test.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 role="document">
<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>
<li class="toctree-l1"><a class="reference internal" href="../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"><a class="reference internal" href="../../ACardEmulator/README.html">Android 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="../../npa/README.html">nPA Smart Card Library</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../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="#">SmartcardSAM_test Module</a></li>
</ul>
</ul>
</li>
<li>
<a href="virtualsmartcard.tests.CryptoUtils_test.html" title="Previous Chapter: CryptoUtils_test Module"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; CryptoUtils_test...</span>
</a>
</li>
<li>
<a href="virtualsmartcard.tests.utils_test.html" title="Next Chapter: utils_test Module"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">utils_test Modul... &raquo;</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="smartcardsam-test-module">
<h1>SmartcardSAM_test Module<a class="headerlink" href="#smartcardsam-test-module" title="Permalink to this headline"></a></h1>
<p class="graphviz">
<img src="../../_images/inheritance-6bbe035741f5d2dcb113ca7864c78d0280548c16.png" alt="Inheritance diagram of virtualsmartcard.tests.SmartcardSAM_test" usemap="#inheritance91c24ce5a0" class="inheritance"/>
<map id="inheritance91c24ce5a0" name="inheritance91c24ce5a0">
<area shape="rect" id="node1" title="A class whose instances are single test cases." alt="" coords="5,5,172,31"/>
<area shape="rect" id="node2" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM" title="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM" alt="" coords="220,5,639,31"/>
</map>
</p>
<span class="target" id="module-virtualsmartcard.tests.SmartcardSAM_test"></span><dl class="class">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM">
<em class="property">class </em><code class="descclassname">virtualsmartcard.tests.SmartcardSAM_test.</code><code class="descname">TestSmartcardSAM</code><span class="sig-paren">(</span><em>methodName='runTest'</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">unittest.case.TestCase</span></code></p>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM._addSkip">
<code class="descname">_addSkip</code><span class="sig-paren">(</span><em>result</em>, <em>reason</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM._addSkip" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM._baseAssertEqual">
<code class="descname">_baseAssertEqual</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM._baseAssertEqual" title="Permalink to this definition"></a></dt>
<dd><p>The default assertEqual implementation, not type specific.</p>
</dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM._classSetupFailed">
<code class="descname">_classSetupFailed</code><em class="property"> = False</em><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM._classSetupFailed" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM._deprecate">
<code class="descname">_deprecate</code><span class="sig-paren">(</span><em>original_func</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM._deprecate" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM._diffThreshold">
<code class="descname">_diffThreshold</code><em class="property"> = 65536</em><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM._diffThreshold" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM._formatMessage">
<code class="descname">_formatMessage</code><span class="sig-paren">(</span><em>msg</em>, <em>standardMsg</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM._formatMessage" title="Permalink to this definition"></a></dt>
<dd><p>Honour the longMessage attribute when generating failure messages.
If longMessage is False this means:
* Use only an explicit message if it is provided
* Otherwise use the standard message for the assert</p>
<p>If longMessage is True:
* Use the standard message
* If an explicit message is provided, plus &#8216; : &#8216; and the explicit message</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM._getAssertEqualityFunc">
<code class="descname">_getAssertEqualityFunc</code><span class="sig-paren">(</span><em>first</em>, <em>second</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM._getAssertEqualityFunc" title="Permalink to this definition"></a></dt>
<dd><p>Get a detailed comparison function for the types of the two args.</p>
<p>Returns: A callable accepting (first, second, msg=None) that will
raise a failure exception if first != second with a useful human
readable error message for those types.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM._truncateMessage">
<code class="descname">_truncateMessage</code><span class="sig-paren">(</span><em>message</em>, <em>diff</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM._truncateMessage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.addCleanup">
<code class="descname">addCleanup</code><span class="sig-paren">(</span><em>function</em>, <em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.addCleanup" title="Permalink to this definition"></a></dt>
<dd><p>Add a function, with arguments, to be called when the test is
completed. Functions added are called on a LIFO basis and are
called after tearDown on test failure or success.</p>
<p>Cleanup items are called even if setUp fails (unlike tearDown).</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.addTypeEqualityFunc">
<code class="descname">addTypeEqualityFunc</code><span class="sig-paren">(</span><em>typeobj</em>, <em>function</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.addTypeEqualityFunc" title="Permalink to this definition"></a></dt>
<dd><p>Add a type specific assertEqual style function to compare a type.</p>
<p>This method is for use by TestCase subclasses that need to register
their own type equality functions to provide nicer error messages.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><dl class="first last docutils">
<dt>typeobj: The data type to call this function on when both values</dt>
<dd>are of the same type in assertEqual().</dd>
<dt>function: The callable taking two arguments and an optional</dt>
<dd>msg= argument that raises self.failureException with a
useful error message when the two arguments are not equal.</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertAlmostEqual">
<code class="descname">assertAlmostEqual</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>places=None</em>, <em>msg=None</em>, <em>delta=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertAlmostEqual" title="Permalink to this definition"></a></dt>
<dd><p>Fail if the two objects are unequal as determined by their
difference rounded to the given number of decimal places
(default 7) and comparing to zero, or by comparing that the
between the two objects is more than the given delta.</p>
<p>Note that decimal places (from zero) are usually not the same
as significant digits (measured from the most signficant digit).</p>
<p>If the two objects compare equal then they will automatically
compare almost equal.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertAlmostEquals">
<code class="descname">assertAlmostEquals</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>places=None</em>, <em>msg=None</em>, <em>delta=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertAlmostEquals" title="Permalink to this definition"></a></dt>
<dd><p>Fail if the two objects are unequal as determined by their
difference rounded to the given number of decimal places
(default 7) and comparing to zero, or by comparing that the
between the two objects is more than the given delta.</p>
<p>Note that decimal places (from zero) are usually not the same
as significant digits (measured from the most signficant digit).</p>
<p>If the two objects compare equal then they will automatically
compare almost equal.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertDictContainsSubset">
<code class="descname">assertDictContainsSubset</code><span class="sig-paren">(</span><em>expected</em>, <em>actual</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertDictContainsSubset" title="Permalink to this definition"></a></dt>
<dd><p>Checks whether actual is a superset of expected.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertDictEqual">
<code class="descname">assertDictEqual</code><span class="sig-paren">(</span><em>d1</em>, <em>d2</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertDictEqual" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertEqual">
<code class="descname">assertEqual</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertEqual" title="Permalink to this definition"></a></dt>
<dd><p>Fail if the two objects are unequal as determined by the &#8216;==&#8217;
operator.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertEquals">
<code class="descname">assertEquals</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertEquals" title="Permalink to this definition"></a></dt>
<dd><p>Fail if the two objects are unequal as determined by the &#8216;==&#8217;
operator.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertFalse">
<code class="descname">assertFalse</code><span class="sig-paren">(</span><em>expr</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertFalse" title="Permalink to this definition"></a></dt>
<dd><p>Check that the expression is false.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertGreater">
<code class="descname">assertGreater</code><span class="sig-paren">(</span><em>a</em>, <em>b</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertGreater" title="Permalink to this definition"></a></dt>
<dd><p>Just like self.assertTrue(a &gt; b), but with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertGreaterEqual">
<code class="descname">assertGreaterEqual</code><span class="sig-paren">(</span><em>a</em>, <em>b</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertGreaterEqual" title="Permalink to this definition"></a></dt>
<dd><p>Just like self.assertTrue(a &gt;= b), but with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertIn">
<code class="descname">assertIn</code><span class="sig-paren">(</span><em>member</em>, <em>container</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertIn" title="Permalink to this definition"></a></dt>
<dd><p>Just like self.assertTrue(a in b), but with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertIs">
<code class="descname">assertIs</code><span class="sig-paren">(</span><em>expr1</em>, <em>expr2</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertIs" title="Permalink to this definition"></a></dt>
<dd><p>Just like self.assertTrue(a is b), but with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertIsInstance">
<code class="descname">assertIsInstance</code><span class="sig-paren">(</span><em>obj</em>, <em>cls</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertIsInstance" title="Permalink to this definition"></a></dt>
<dd><p>Same as self.assertTrue(isinstance(obj, cls)), with a nicer
default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertIsNone">
<code class="descname">assertIsNone</code><span class="sig-paren">(</span><em>obj</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertIsNone" title="Permalink to this definition"></a></dt>
<dd><p>Same as self.assertTrue(obj is None), with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertIsNot">
<code class="descname">assertIsNot</code><span class="sig-paren">(</span><em>expr1</em>, <em>expr2</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertIsNot" title="Permalink to this definition"></a></dt>
<dd><p>Just like self.assertTrue(a is not b), but with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertIsNotNone">
<code class="descname">assertIsNotNone</code><span class="sig-paren">(</span><em>obj</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertIsNotNone" title="Permalink to this definition"></a></dt>
<dd><p>Included for symmetry with assertIsNone.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertItemsEqual">
<code class="descname">assertItemsEqual</code><span class="sig-paren">(</span><em>expected_seq</em>, <em>actual_seq</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertItemsEqual" title="Permalink to this definition"></a></dt>
<dd><p>An unordered sequence specific comparison. It asserts that
actual_seq and expected_seq have the same element counts.
Equivalent to:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">Counter</span><span class="p">(</span><span class="nb">iter</span><span class="p">(</span><span class="n">actual_seq</span><span class="p">)),</span>
<span class="n">Counter</span><span class="p">(</span><span class="nb">iter</span><span class="p">(</span><span class="n">expected_seq</span><span class="p">)))</span>
</pre></div>
</div>
<p>Asserts that each element has the same count in both sequences.
Example:</p>
<blockquote>
<div><ul class="simple">
<li>[0, 1, 1] and [1, 0, 1] compare equal.</li>
<li>[0, 0, 1] and [0, 1] compare unequal.</li>
</ul>
</div></blockquote>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertLess">
<code class="descname">assertLess</code><span class="sig-paren">(</span><em>a</em>, <em>b</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertLess" title="Permalink to this definition"></a></dt>
<dd><p>Just like self.assertTrue(a &lt; b), but with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertLessEqual">
<code class="descname">assertLessEqual</code><span class="sig-paren">(</span><em>a</em>, <em>b</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertLessEqual" title="Permalink to this definition"></a></dt>
<dd><p>Just like self.assertTrue(a &lt;= b), but with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertListEqual">
<code class="descname">assertListEqual</code><span class="sig-paren">(</span><em>list1</em>, <em>list2</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertListEqual" title="Permalink to this definition"></a></dt>
<dd><p>A list-specific equality assertion.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><p class="first">list1: The first list to compare.
list2: The second list to compare.
msg: Optional message to use on failure instead of a list of</p>
<blockquote class="last">
<div>differences.</div></blockquote>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertMultiLineEqual">
<code class="descname">assertMultiLineEqual</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertMultiLineEqual" title="Permalink to this definition"></a></dt>
<dd><p>Assert that two multi-line strings are equal.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertNotAlmostEqual">
<code class="descname">assertNotAlmostEqual</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>places=None</em>, <em>msg=None</em>, <em>delta=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertNotAlmostEqual" title="Permalink to this definition"></a></dt>
<dd><p>Fail if the two objects are equal as determined by their
difference rounded to the given number of decimal places
(default 7) and comparing to zero, or by comparing that the
between the two objects is less than the given delta.</p>
<p>Note that decimal places (from zero) are usually not the same
as significant digits (measured from the most signficant digit).</p>
<p>Objects that are equal automatically fail.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertNotAlmostEquals">
<code class="descname">assertNotAlmostEquals</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>places=None</em>, <em>msg=None</em>, <em>delta=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertNotAlmostEquals" title="Permalink to this definition"></a></dt>
<dd><p>Fail if the two objects are equal as determined by their
difference rounded to the given number of decimal places
(default 7) and comparing to zero, or by comparing that the
between the two objects is less than the given delta.</p>
<p>Note that decimal places (from zero) are usually not the same
as significant digits (measured from the most signficant digit).</p>
<p>Objects that are equal automatically fail.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertNotEqual">
<code class="descname">assertNotEqual</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertNotEqual" title="Permalink to this definition"></a></dt>
<dd><p>Fail if the two objects are equal as determined by the &#8216;!=&#8217;
operator.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertNotEquals">
<code class="descname">assertNotEquals</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertNotEquals" title="Permalink to this definition"></a></dt>
<dd><p>Fail if the two objects are equal as determined by the &#8216;!=&#8217;
operator.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertNotIn">
<code class="descname">assertNotIn</code><span class="sig-paren">(</span><em>member</em>, <em>container</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertNotIn" title="Permalink to this definition"></a></dt>
<dd><p>Just like self.assertTrue(a not in b), but with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertNotIsInstance">
<code class="descname">assertNotIsInstance</code><span class="sig-paren">(</span><em>obj</em>, <em>cls</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertNotIsInstance" title="Permalink to this definition"></a></dt>
<dd><p>Included for symmetry with assertIsInstance.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertNotRegexpMatches">
<code class="descname">assertNotRegexpMatches</code><span class="sig-paren">(</span><em>text</em>, <em>unexpected_regexp</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertNotRegexpMatches" title="Permalink to this definition"></a></dt>
<dd><p>Fail the test if the text matches the regular expression.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertRaises">
<code class="descname">assertRaises</code><span class="sig-paren">(</span><em>excClass</em>, <em>callableObj=None</em>, <em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertRaises" title="Permalink to this definition"></a></dt>
<dd><p>Fail unless an exception of class excClass is raised
by callableObj when invoked with arguments args and keyword
arguments kwargs. If a different type of exception is
raised, it will not be caught, and the test case will be
deemed to have suffered an error, exactly as for an
unexpected exception.</p>
<p>If called with callableObj omitted or None, will return a
context object used like this:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">assertRaises</span><span class="p">(</span><span class="n">SomeException</span><span class="p">):</span>
<span class="n">do_something</span><span class="p">()</span>
</pre></div>
</div>
<p>The context manager keeps a reference to the exception as
the &#8216;exception&#8217; attribute. This allows you to inspect the
exception after the assertion:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">assertRaises</span><span class="p">(</span><span class="n">SomeException</span><span class="p">)</span> <span class="k">as</span> <span class="n">cm</span><span class="p">:</span>
<span class="n">do_something</span><span class="p">()</span>
<span class="n">the_exception</span> <span class="o">=</span> <span class="n">cm</span><span class="o">.</span><span class="n">exception</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">the_exception</span><span class="o">.</span><span class="n">error_code</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertRaisesRegexp">
<code class="descname">assertRaisesRegexp</code><span class="sig-paren">(</span><em>expected_exception</em>, <em>expected_regexp</em>, <em>callable_obj=None</em>, <em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertRaisesRegexp" title="Permalink to this definition"></a></dt>
<dd><p>Asserts that the message in a raised exception matches a regexp.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><p class="first">expected_exception: Exception class expected to be raised.
expected_regexp: Regexp (re pattern object or string) expected</p>
<blockquote>
<div>to be found in error message.</div></blockquote>
<p class="last">callable_obj: Function to be called.
args: Extra args.
kwargs: Extra kwargs.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertRegexpMatches">
<code class="descname">assertRegexpMatches</code><span class="sig-paren">(</span><em>text</em>, <em>expected_regexp</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertRegexpMatches" title="Permalink to this definition"></a></dt>
<dd><p>Fail the test unless the text matches the regular expression.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertSequenceEqual">
<code class="descname">assertSequenceEqual</code><span class="sig-paren">(</span><em>seq1</em>, <em>seq2</em>, <em>msg=None</em>, <em>seq_type=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertSequenceEqual" title="Permalink to this definition"></a></dt>
<dd><p>An equality assertion for ordered sequences (like lists and tuples).</p>
<p>For the purposes of this function, a valid ordered sequence type is one
which can be indexed, has a length, and has an equality operator.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><p class="first">seq1: The first sequence to compare.
seq2: The second sequence to compare.
seq_type: The expected datatype of the sequences, or None if no</p>
<blockquote>
<div>datatype should be enforced.</div></blockquote>
<dl class="last docutils">
<dt>msg: Optional message to use on failure instead of a list of</dt>
<dd>differences.</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertSetEqual">
<code class="descname">assertSetEqual</code><span class="sig-paren">(</span><em>set1</em>, <em>set2</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertSetEqual" title="Permalink to this definition"></a></dt>
<dd><p>A set-specific equality assertion.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><p class="first">set1: The first set to compare.
set2: The second set to compare.
msg: Optional message to use on failure instead of a list of</p>
<blockquote class="last">
<div>differences.</div></blockquote>
</dd>
</dl>
<p>assertSetEqual uses ducktyping to support different types of sets, and
is optimized for sets specifically (parameters must support a
difference method).</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertTrue">
<code class="descname">assertTrue</code><span class="sig-paren">(</span><em>expr</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertTrue" title="Permalink to this definition"></a></dt>
<dd><p>Check that the expression is true.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertTupleEqual">
<code class="descname">assertTupleEqual</code><span class="sig-paren">(</span><em>tuple1</em>, <em>tuple2</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assertTupleEqual" title="Permalink to this definition"></a></dt>
<dd><p>A tuple-specific equality assertion.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><p class="first">tuple1: The first tuple to compare.
tuple2: The second tuple to compare.
msg: Optional message to use on failure instead of a list of</p>
<blockquote class="last">
<div>differences.</div></blockquote>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assert_">
<code class="descname">assert_</code><span class="sig-paren">(</span><em>expr</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.assert_" title="Permalink to this definition"></a></dt>
<dd><p>Check that the expression is true.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.countTestCases">
<code class="descname">countTestCases</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.countTestCases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.debug">
<code class="descname">debug</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.debug" title="Permalink to this definition"></a></dt>
<dd><p>Run the test without collecting errors in a TestResult</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.defaultTestResult">
<code class="descname">defaultTestResult</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.defaultTestResult" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.doCleanups">
<code class="descname">doCleanups</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.doCleanups" title="Permalink to this definition"></a></dt>
<dd><p>Execute all cleanup functions. Normally called for you after
tearDown.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.fail">
<code class="descname">fail</code><span class="sig-paren">(</span><em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.fail" title="Permalink to this definition"></a></dt>
<dd><p>Fail immediately, with the given message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.failIf">
<code class="descname">failIf</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.failIf" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.failIfAlmostEqual">
<code class="descname">failIfAlmostEqual</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.failIfAlmostEqual" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.failIfEqual">
<code class="descname">failIfEqual</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.failIfEqual" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.failUnless">
<code class="descname">failUnless</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.failUnless" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.failUnlessAlmostEqual">
<code class="descname">failUnlessAlmostEqual</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.failUnlessAlmostEqual" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.failUnlessEqual">
<code class="descname">failUnlessEqual</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.failUnlessEqual" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.failUnlessRaises">
<code class="descname">failUnlessRaises</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.failUnlessRaises" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.failureException">
<code class="descname">failureException</code><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.failureException" title="Permalink to this definition"></a></dt>
<dd><p>alias of <code class="xref py py-class docutils literal"><span class="pre">AssertionError</span></code></p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.id">
<code class="descname">id</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.id" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.longMessage">
<code class="descname">longMessage</code><em class="property"> = False</em><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.longMessage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.maxDiff">
<code class="descname">maxDiff</code><em class="property"> = 640</em><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.maxDiff" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.run">
<code class="descname">run</code><span class="sig-paren">(</span><em>result=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.run" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.setUp">
<code class="descname">setUp</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.setUp" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.setUpClass">
<code class="descname">setUpClass</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.setUpClass" title="Permalink to this definition"></a></dt>
<dd><p>Hook method for setting up class fixture before running tests in the class.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.shortDescription">
<code class="descname">shortDescription</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.shortDescription" title="Permalink to this definition"></a></dt>
<dd><p>Returns a one-line description of the test, or None if no
description has been provided.</p>
<p>The default implementation of this method returns the first line of
the specified test method&#8217;s docstring.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.skipTest">
<code class="descname">skipTest</code><span class="sig-paren">(</span><em>reason</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.skipTest" title="Permalink to this definition"></a></dt>
<dd><p>Skip this test.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.tearDown">
<code class="descname">tearDown</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.tearDown" title="Permalink to this definition"></a></dt>
<dd><p>Hook method for deconstructing the test fixture after testing it.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.tearDownClass">
<code class="descname">tearDownClass</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.tearDownClass" title="Permalink to this definition"></a></dt>
<dd><p>Hook method for deconstructing the class fixture after running all tests in the class.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.test_counter_decrement">
<code class="descname">test_counter_decrement</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.test_counter_decrement" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.test_external_authenticate">
<code class="descname">test_external_authenticate</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.test_external_authenticate" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.test_incorrect_pin">
<code class="descname">test_incorrect_pin</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.test_incorrect_pin" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.test_internal_authenticate">
<code class="descname">test_internal_authenticate</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.test_internal_authenticate" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.test_security_environment">
<code class="descname">test_security_environment</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.SmartcardSAM_test.TestSmartcardSAM.test_security_environment" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
&copy; Copyright 2009-2016 by Dominik Oepen and Frank Morgner.<br/>
</p>
</div>
</footer>
</body>
</html>

View File

@@ -0,0 +1,183 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>tests Package &mdash; vsmartcard 2016-10-10 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: '2016-10-10',
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 2016-10-10 documentation" href="../../index.html" />
<link rel="up" title="virtualsmartcard Package" href="virtualsmartcard.html" />
<link rel="next" title="CardGenerator_test Module" href="virtualsmartcard.tests.CardGenerator_test.html" />
<link rel="prev" title="nPA Module" href="virtualsmartcard.cards.nPA.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 role="document">
<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>
<li class="toctree-l1"><a class="reference internal" href="../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"><a class="reference internal" href="../../ACardEmulator/README.html">Android 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="../../npa/README.html">nPA Smart Card Library</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../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="#">tests Package</a></li>
</ul>
</ul>
</li>
<li>
<a href="virtualsmartcard.cards.nPA.html" title="Previous Chapter: nPA Module"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; nPA Module</span>
</a>
</li>
<li>
<a href="virtualsmartcard.tests.CardGenerator_test.html" title="Next Chapter: CardGenerator_test Module"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">CardGenerator_te... &raquo;</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="tests-package">
<h1>tests Package<a class="headerlink" href="#tests-package" title="Permalink to this headline"></a></h1>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="virtualsmartcard.tests.CardGenerator_test.html">CardGenerator_test Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="virtualsmartcard.tests.CryptoUtils_test.html">CryptoUtils_test Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="virtualsmartcard.tests.SmartcardSAM_test.html">SmartcardSAM_test Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="virtualsmartcard.tests.utils_test.html">utils_test Module</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
&copy; Copyright 2009-2016 by Dominik Oepen and Frank Morgner.<br/>
</p>
</div>
</footer>
</body>
</html>

View File

@@ -0,0 +1,737 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>utils_test Module &mdash; vsmartcard 2016-10-10 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: '2016-10-10',
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 2016-10-10 documentation" href="../../index.html" />
<link rel="up" title="tests Package" href="virtualsmartcard.tests.html" />
<link rel="next" title="CardGenerator Module" href="virtualsmartcard.CardGenerator.html" />
<link rel="prev" title="SmartcardSAM_test Module" href="virtualsmartcard.tests.SmartcardSAM_test.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 role="document">
<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>
<li class="toctree-l1"><a class="reference internal" href="../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"><a class="reference internal" href="../../ACardEmulator/README.html">Android 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="../../npa/README.html">nPA Smart Card Library</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../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="#">utils_test Module</a></li>
</ul>
</ul>
</li>
<li>
<a href="virtualsmartcard.tests.SmartcardSAM_test.html" title="Previous Chapter: SmartcardSAM_test Module"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; SmartcardSAM_tes...</span>
</a>
</li>
<li>
<a href="virtualsmartcard.CardGenerator.html" title="Next Chapter: CardGenerator Module"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">CardGenerator Mo... &raquo;</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="utils-test-module">
<h1>utils_test Module<a class="headerlink" href="#utils-test-module" title="Permalink to this headline"></a></h1>
<p class="graphviz">
<img src="../../_images/inheritance-e1d6573d10e97f2502d55eaa993e54e501d1540a.png" alt="Inheritance diagram of virtualsmartcard.tests.utils_test" usemap="#inheritancedaa185e5f0" class="inheritance"/>
<map id="inheritancedaa185e5f0" name="inheritancedaa185e5f0">
<area shape="rect" id="node1" title="A class whose instances are single test cases." alt="" coords="5,5,172,31"/>
<area shape="rect" id="node2" href="#virtualsmartcard.tests.utils_test.TestUtils" title="virtualsmartcard.tests.utils_test.TestUtils" alt="" coords="220,5,503,31"/>
</map>
</p>
<span class="target" id="module-virtualsmartcard.tests.utils_test"></span><dl class="class">
<dt id="virtualsmartcard.tests.utils_test.TestUtils">
<em class="property">class </em><code class="descclassname">virtualsmartcard.tests.utils_test.</code><code class="descname">TestUtils</code><span class="sig-paren">(</span><em>methodName='runTest'</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">unittest.case.TestCase</span></code></p>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils._addSkip">
<code class="descname">_addSkip</code><span class="sig-paren">(</span><em>result</em>, <em>reason</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils._addSkip" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils._baseAssertEqual">
<code class="descname">_baseAssertEqual</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils._baseAssertEqual" title="Permalink to this definition"></a></dt>
<dd><p>The default assertEqual implementation, not type specific.</p>
</dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.tests.utils_test.TestUtils._classSetupFailed">
<code class="descname">_classSetupFailed</code><em class="property"> = False</em><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils._classSetupFailed" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils._deprecate">
<code class="descname">_deprecate</code><span class="sig-paren">(</span><em>original_func</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils._deprecate" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.tests.utils_test.TestUtils._diffThreshold">
<code class="descname">_diffThreshold</code><em class="property"> = 65536</em><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils._diffThreshold" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils._formatMessage">
<code class="descname">_formatMessage</code><span class="sig-paren">(</span><em>msg</em>, <em>standardMsg</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils._formatMessage" title="Permalink to this definition"></a></dt>
<dd><p>Honour the longMessage attribute when generating failure messages.
If longMessage is False this means:
* Use only an explicit message if it is provided
* Otherwise use the standard message for the assert</p>
<p>If longMessage is True:
* Use the standard message
* If an explicit message is provided, plus &#8216; : &#8216; and the explicit message</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils._getAssertEqualityFunc">
<code class="descname">_getAssertEqualityFunc</code><span class="sig-paren">(</span><em>first</em>, <em>second</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils._getAssertEqualityFunc" title="Permalink to this definition"></a></dt>
<dd><p>Get a detailed comparison function for the types of the two args.</p>
<p>Returns: A callable accepting (first, second, msg=None) that will
raise a failure exception if first != second with a useful human
readable error message for those types.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils._truncateMessage">
<code class="descname">_truncateMessage</code><span class="sig-paren">(</span><em>message</em>, <em>diff</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils._truncateMessage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.addCleanup">
<code class="descname">addCleanup</code><span class="sig-paren">(</span><em>function</em>, <em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.addCleanup" title="Permalink to this definition"></a></dt>
<dd><p>Add a function, with arguments, to be called when the test is
completed. Functions added are called on a LIFO basis and are
called after tearDown on test failure or success.</p>
<p>Cleanup items are called even if setUp fails (unlike tearDown).</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.addTypeEqualityFunc">
<code class="descname">addTypeEqualityFunc</code><span class="sig-paren">(</span><em>typeobj</em>, <em>function</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.addTypeEqualityFunc" title="Permalink to this definition"></a></dt>
<dd><p>Add a type specific assertEqual style function to compare a type.</p>
<p>This method is for use by TestCase subclasses that need to register
their own type equality functions to provide nicer error messages.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><dl class="first last docutils">
<dt>typeobj: The data type to call this function on when both values</dt>
<dd>are of the same type in assertEqual().</dd>
<dt>function: The callable taking two arguments and an optional</dt>
<dd>msg= argument that raises self.failureException with a
useful error message when the two arguments are not equal.</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertAlmostEqual">
<code class="descname">assertAlmostEqual</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>places=None</em>, <em>msg=None</em>, <em>delta=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertAlmostEqual" title="Permalink to this definition"></a></dt>
<dd><p>Fail if the two objects are unequal as determined by their
difference rounded to the given number of decimal places
(default 7) and comparing to zero, or by comparing that the
between the two objects is more than the given delta.</p>
<p>Note that decimal places (from zero) are usually not the same
as significant digits (measured from the most signficant digit).</p>
<p>If the two objects compare equal then they will automatically
compare almost equal.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertAlmostEquals">
<code class="descname">assertAlmostEquals</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>places=None</em>, <em>msg=None</em>, <em>delta=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertAlmostEquals" title="Permalink to this definition"></a></dt>
<dd><p>Fail if the two objects are unequal as determined by their
difference rounded to the given number of decimal places
(default 7) and comparing to zero, or by comparing that the
between the two objects is more than the given delta.</p>
<p>Note that decimal places (from zero) are usually not the same
as significant digits (measured from the most signficant digit).</p>
<p>If the two objects compare equal then they will automatically
compare almost equal.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertDictContainsSubset">
<code class="descname">assertDictContainsSubset</code><span class="sig-paren">(</span><em>expected</em>, <em>actual</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertDictContainsSubset" title="Permalink to this definition"></a></dt>
<dd><p>Checks whether actual is a superset of expected.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertDictEqual">
<code class="descname">assertDictEqual</code><span class="sig-paren">(</span><em>d1</em>, <em>d2</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertDictEqual" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertEqual">
<code class="descname">assertEqual</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertEqual" title="Permalink to this definition"></a></dt>
<dd><p>Fail if the two objects are unequal as determined by the &#8216;==&#8217;
operator.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertEquals">
<code class="descname">assertEquals</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertEquals" title="Permalink to this definition"></a></dt>
<dd><p>Fail if the two objects are unequal as determined by the &#8216;==&#8217;
operator.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertFalse">
<code class="descname">assertFalse</code><span class="sig-paren">(</span><em>expr</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertFalse" title="Permalink to this definition"></a></dt>
<dd><p>Check that the expression is false.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertGreater">
<code class="descname">assertGreater</code><span class="sig-paren">(</span><em>a</em>, <em>b</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertGreater" title="Permalink to this definition"></a></dt>
<dd><p>Just like self.assertTrue(a &gt; b), but with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertGreaterEqual">
<code class="descname">assertGreaterEqual</code><span class="sig-paren">(</span><em>a</em>, <em>b</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertGreaterEqual" title="Permalink to this definition"></a></dt>
<dd><p>Just like self.assertTrue(a &gt;= b), but with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertIn">
<code class="descname">assertIn</code><span class="sig-paren">(</span><em>member</em>, <em>container</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertIn" title="Permalink to this definition"></a></dt>
<dd><p>Just like self.assertTrue(a in b), but with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertIs">
<code class="descname">assertIs</code><span class="sig-paren">(</span><em>expr1</em>, <em>expr2</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertIs" title="Permalink to this definition"></a></dt>
<dd><p>Just like self.assertTrue(a is b), but with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertIsInstance">
<code class="descname">assertIsInstance</code><span class="sig-paren">(</span><em>obj</em>, <em>cls</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertIsInstance" title="Permalink to this definition"></a></dt>
<dd><p>Same as self.assertTrue(isinstance(obj, cls)), with a nicer
default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertIsNone">
<code class="descname">assertIsNone</code><span class="sig-paren">(</span><em>obj</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertIsNone" title="Permalink to this definition"></a></dt>
<dd><p>Same as self.assertTrue(obj is None), with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertIsNot">
<code class="descname">assertIsNot</code><span class="sig-paren">(</span><em>expr1</em>, <em>expr2</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertIsNot" title="Permalink to this definition"></a></dt>
<dd><p>Just like self.assertTrue(a is not b), but with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertIsNotNone">
<code class="descname">assertIsNotNone</code><span class="sig-paren">(</span><em>obj</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertIsNotNone" title="Permalink to this definition"></a></dt>
<dd><p>Included for symmetry with assertIsNone.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertItemsEqual">
<code class="descname">assertItemsEqual</code><span class="sig-paren">(</span><em>expected_seq</em>, <em>actual_seq</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertItemsEqual" title="Permalink to this definition"></a></dt>
<dd><p>An unordered sequence specific comparison. It asserts that
actual_seq and expected_seq have the same element counts.
Equivalent to:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">Counter</span><span class="p">(</span><span class="nb">iter</span><span class="p">(</span><span class="n">actual_seq</span><span class="p">)),</span>
<span class="n">Counter</span><span class="p">(</span><span class="nb">iter</span><span class="p">(</span><span class="n">expected_seq</span><span class="p">)))</span>
</pre></div>
</div>
<p>Asserts that each element has the same count in both sequences.
Example:</p>
<blockquote>
<div><ul class="simple">
<li>[0, 1, 1] and [1, 0, 1] compare equal.</li>
<li>[0, 0, 1] and [0, 1] compare unequal.</li>
</ul>
</div></blockquote>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertLess">
<code class="descname">assertLess</code><span class="sig-paren">(</span><em>a</em>, <em>b</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertLess" title="Permalink to this definition"></a></dt>
<dd><p>Just like self.assertTrue(a &lt; b), but with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertLessEqual">
<code class="descname">assertLessEqual</code><span class="sig-paren">(</span><em>a</em>, <em>b</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertLessEqual" title="Permalink to this definition"></a></dt>
<dd><p>Just like self.assertTrue(a &lt;= b), but with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertListEqual">
<code class="descname">assertListEqual</code><span class="sig-paren">(</span><em>list1</em>, <em>list2</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertListEqual" title="Permalink to this definition"></a></dt>
<dd><p>A list-specific equality assertion.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><p class="first">list1: The first list to compare.
list2: The second list to compare.
msg: Optional message to use on failure instead of a list of</p>
<blockquote class="last">
<div>differences.</div></blockquote>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertMultiLineEqual">
<code class="descname">assertMultiLineEqual</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertMultiLineEqual" title="Permalink to this definition"></a></dt>
<dd><p>Assert that two multi-line strings are equal.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertNotAlmostEqual">
<code class="descname">assertNotAlmostEqual</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>places=None</em>, <em>msg=None</em>, <em>delta=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertNotAlmostEqual" title="Permalink to this definition"></a></dt>
<dd><p>Fail if the two objects are equal as determined by their
difference rounded to the given number of decimal places
(default 7) and comparing to zero, or by comparing that the
between the two objects is less than the given delta.</p>
<p>Note that decimal places (from zero) are usually not the same
as significant digits (measured from the most signficant digit).</p>
<p>Objects that are equal automatically fail.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertNotAlmostEquals">
<code class="descname">assertNotAlmostEquals</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>places=None</em>, <em>msg=None</em>, <em>delta=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertNotAlmostEquals" title="Permalink to this definition"></a></dt>
<dd><p>Fail if the two objects are equal as determined by their
difference rounded to the given number of decimal places
(default 7) and comparing to zero, or by comparing that the
between the two objects is less than the given delta.</p>
<p>Note that decimal places (from zero) are usually not the same
as significant digits (measured from the most signficant digit).</p>
<p>Objects that are equal automatically fail.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertNotEqual">
<code class="descname">assertNotEqual</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertNotEqual" title="Permalink to this definition"></a></dt>
<dd><p>Fail if the two objects are equal as determined by the &#8216;!=&#8217;
operator.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertNotEquals">
<code class="descname">assertNotEquals</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertNotEquals" title="Permalink to this definition"></a></dt>
<dd><p>Fail if the two objects are equal as determined by the &#8216;!=&#8217;
operator.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertNotIn">
<code class="descname">assertNotIn</code><span class="sig-paren">(</span><em>member</em>, <em>container</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertNotIn" title="Permalink to this definition"></a></dt>
<dd><p>Just like self.assertTrue(a not in b), but with a nicer default message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertNotIsInstance">
<code class="descname">assertNotIsInstance</code><span class="sig-paren">(</span><em>obj</em>, <em>cls</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertNotIsInstance" title="Permalink to this definition"></a></dt>
<dd><p>Included for symmetry with assertIsInstance.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertNotRegexpMatches">
<code class="descname">assertNotRegexpMatches</code><span class="sig-paren">(</span><em>text</em>, <em>unexpected_regexp</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertNotRegexpMatches" title="Permalink to this definition"></a></dt>
<dd><p>Fail the test if the text matches the regular expression.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertRaises">
<code class="descname">assertRaises</code><span class="sig-paren">(</span><em>excClass</em>, <em>callableObj=None</em>, <em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertRaises" title="Permalink to this definition"></a></dt>
<dd><p>Fail unless an exception of class excClass is raised
by callableObj when invoked with arguments args and keyword
arguments kwargs. If a different type of exception is
raised, it will not be caught, and the test case will be
deemed to have suffered an error, exactly as for an
unexpected exception.</p>
<p>If called with callableObj omitted or None, will return a
context object used like this:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">assertRaises</span><span class="p">(</span><span class="n">SomeException</span><span class="p">):</span>
<span class="n">do_something</span><span class="p">()</span>
</pre></div>
</div>
<p>The context manager keeps a reference to the exception as
the &#8216;exception&#8217; attribute. This allows you to inspect the
exception after the assertion:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">assertRaises</span><span class="p">(</span><span class="n">SomeException</span><span class="p">)</span> <span class="k">as</span> <span class="n">cm</span><span class="p">:</span>
<span class="n">do_something</span><span class="p">()</span>
<span class="n">the_exception</span> <span class="o">=</span> <span class="n">cm</span><span class="o">.</span><span class="n">exception</span>
<span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">the_exception</span><span class="o">.</span><span class="n">error_code</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertRaisesRegexp">
<code class="descname">assertRaisesRegexp</code><span class="sig-paren">(</span><em>expected_exception</em>, <em>expected_regexp</em>, <em>callable_obj=None</em>, <em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertRaisesRegexp" title="Permalink to this definition"></a></dt>
<dd><p>Asserts that the message in a raised exception matches a regexp.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><p class="first">expected_exception: Exception class expected to be raised.
expected_regexp: Regexp (re pattern object or string) expected</p>
<blockquote>
<div>to be found in error message.</div></blockquote>
<p class="last">callable_obj: Function to be called.
args: Extra args.
kwargs: Extra kwargs.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertRegexpMatches">
<code class="descname">assertRegexpMatches</code><span class="sig-paren">(</span><em>text</em>, <em>expected_regexp</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertRegexpMatches" title="Permalink to this definition"></a></dt>
<dd><p>Fail the test unless the text matches the regular expression.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertSequenceEqual">
<code class="descname">assertSequenceEqual</code><span class="sig-paren">(</span><em>seq1</em>, <em>seq2</em>, <em>msg=None</em>, <em>seq_type=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertSequenceEqual" title="Permalink to this definition"></a></dt>
<dd><p>An equality assertion for ordered sequences (like lists and tuples).</p>
<p>For the purposes of this function, a valid ordered sequence type is one
which can be indexed, has a length, and has an equality operator.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><p class="first">seq1: The first sequence to compare.
seq2: The second sequence to compare.
seq_type: The expected datatype of the sequences, or None if no</p>
<blockquote>
<div>datatype should be enforced.</div></blockquote>
<dl class="last docutils">
<dt>msg: Optional message to use on failure instead of a list of</dt>
<dd>differences.</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertSetEqual">
<code class="descname">assertSetEqual</code><span class="sig-paren">(</span><em>set1</em>, <em>set2</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertSetEqual" title="Permalink to this definition"></a></dt>
<dd><p>A set-specific equality assertion.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><p class="first">set1: The first set to compare.
set2: The second set to compare.
msg: Optional message to use on failure instead of a list of</p>
<blockquote class="last">
<div>differences.</div></blockquote>
</dd>
</dl>
<p>assertSetEqual uses ducktyping to support different types of sets, and
is optimized for sets specifically (parameters must support a
difference method).</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertTrue">
<code class="descname">assertTrue</code><span class="sig-paren">(</span><em>expr</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertTrue" title="Permalink to this definition"></a></dt>
<dd><p>Check that the expression is true.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assertTupleEqual">
<code class="descname">assertTupleEqual</code><span class="sig-paren">(</span><em>tuple1</em>, <em>tuple2</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assertTupleEqual" title="Permalink to this definition"></a></dt>
<dd><p>A tuple-specific equality assertion.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><p class="first">tuple1: The first tuple to compare.
tuple2: The second tuple to compare.
msg: Optional message to use on failure instead of a list of</p>
<blockquote class="last">
<div>differences.</div></blockquote>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.assert_">
<code class="descname">assert_</code><span class="sig-paren">(</span><em>expr</em>, <em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.assert_" title="Permalink to this definition"></a></dt>
<dd><p>Check that the expression is true.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.countTestCases">
<code class="descname">countTestCases</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.countTestCases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.debug">
<code class="descname">debug</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.debug" title="Permalink to this definition"></a></dt>
<dd><p>Run the test without collecting errors in a TestResult</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.defaultTestResult">
<code class="descname">defaultTestResult</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.defaultTestResult" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.doCleanups">
<code class="descname">doCleanups</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.doCleanups" title="Permalink to this definition"></a></dt>
<dd><p>Execute all cleanup functions. Normally called for you after
tearDown.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.fail">
<code class="descname">fail</code><span class="sig-paren">(</span><em>msg=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.fail" title="Permalink to this definition"></a></dt>
<dd><p>Fail immediately, with the given message.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.failIf">
<code class="descname">failIf</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.failIf" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.failIfAlmostEqual">
<code class="descname">failIfAlmostEqual</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.failIfAlmostEqual" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.failIfEqual">
<code class="descname">failIfEqual</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.failIfEqual" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.failUnless">
<code class="descname">failUnless</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.failUnless" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.failUnlessAlmostEqual">
<code class="descname">failUnlessAlmostEqual</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.failUnlessAlmostEqual" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.failUnlessEqual">
<code class="descname">failUnlessEqual</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.failUnlessEqual" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.failUnlessRaises">
<code class="descname">failUnlessRaises</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.failUnlessRaises" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.failureException">
<code class="descname">failureException</code><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.failureException" title="Permalink to this definition"></a></dt>
<dd><p>alias of <code class="xref py py-class docutils literal"><span class="pre">AssertionError</span></code></p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.id">
<code class="descname">id</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.id" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.longMessage">
<code class="descname">longMessage</code><em class="property"> = False</em><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.longMessage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.maxDiff">
<code class="descname">maxDiff</code><em class="property"> = 640</em><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.maxDiff" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.run">
<code class="descname">run</code><span class="sig-paren">(</span><em>result=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.run" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.setUp">
<code class="descname">setUp</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.setUp" title="Permalink to this definition"></a></dt>
<dd><p>Hook method for setting up the test fixture before exercising it.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.setUpClass">
<code class="descname">setUpClass</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.setUpClass" title="Permalink to this definition"></a></dt>
<dd><p>Hook method for setting up class fixture before running tests in the class.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.shortDescription">
<code class="descname">shortDescription</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.shortDescription" title="Permalink to this definition"></a></dt>
<dd><p>Returns a one-line description of the test, or None if no
description has been provided.</p>
<p>The default implementation of this method returns the first line of
the specified test method&#8217;s docstring.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.skipTest">
<code class="descname">skipTest</code><span class="sig-paren">(</span><em>reason</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.skipTest" title="Permalink to this definition"></a></dt>
<dd><p>Skip this test.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.tearDown">
<code class="descname">tearDown</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.tearDown" title="Permalink to this definition"></a></dt>
<dd><p>Hook method for deconstructing the test fixture after testing it.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.tearDownClass">
<code class="descname">tearDownClass</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.tearDownClass" title="Permalink to this definition"></a></dt>
<dd><p>Hook method for deconstructing the class fixture after running all tests in the class.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.test_CAPDU">
<code class="descname">test_CAPDU</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.test_CAPDU" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.tests.utils_test.TestUtils.test_RAPDU">
<code class="descname">test_RAPDU</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.tests.utils_test.TestUtils.test_RAPDU" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
&copy; Copyright 2009-2016 by Dominik Oepen and Frank Morgner.<br/>
</p>
</div>
</footer>
</body>
</html>

View File

@@ -0,0 +1,498 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>utils Module &mdash; vsmartcard 2016-10-10 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: '2016-10-10',
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 2016-10-10 documentation" href="../../index.html" />
<link rel="up" title="virtualsmartcard Package" href="virtualsmartcard.html" />
<link rel="prev" title="VirtualSmartcard Module" href="virtualsmartcard.VirtualSmartcard.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 role="document">
<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>
<li class="toctree-l1"><a class="reference internal" href="../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"><a class="reference internal" href="../../ACardEmulator/README.html">Android 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="../../npa/README.html">nPA Smart Card Library</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../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="#">utils Module</a></li>
</ul>
</ul>
</li>
<li>
<a href="virtualsmartcard.VirtualSmartcard.html" title="Previous Chapter: VirtualSmartcard Module"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; VirtualSmartcard...</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="utils-module">
<h1>utils Module<a class="headerlink" href="#utils-module" title="Permalink to this headline"></a></h1>
<p class="graphviz">
<img src="../../_images/inheritance-647e4e3af2eb4356e4633a015c7851f55a66a0bd.png" alt="Inheritance diagram of virtualsmartcard.utils" usemap="#inheritance305ec42f0e" class="inheritance"/>
<map id="inheritance305ec42f0e" name="inheritance305ec42f0e">
<area shape="rect" id="node1" href="#virtualsmartcard.utils.APDU" title="Base class for an APDU" alt="" coords="5,31,204,56"/>
<area shape="rect" id="node2" href="#virtualsmartcard.utils.C_APDU" title="Class for a command APDU" alt="" coords="252,5,467,31"/>
<area shape="rect" id="node3" href="#virtualsmartcard.utils.R_APDU" title="Class for a response APDU" alt="" coords="252,55,467,80"/>
</map>
</p>
<span class="target" id="module-virtualsmartcard.utils"></span><dl class="class">
<dt id="virtualsmartcard.utils.APDU">
<em class="property">class </em><code class="descclassname">virtualsmartcard.utils.</code><code class="descname">APDU</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.APDU" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Base class for an APDU</p>
<dl class="method">
<dt id="virtualsmartcard.utils.APDU._deldata">
<code class="descname">_deldata</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.APDU._deldata" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.utils.APDU._format_parts">
<code class="descname">_format_parts</code><span class="sig-paren">(</span><em>fields</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.APDU._format_parts" title="Permalink to this definition"></a></dt>
<dd><p>utility function to be used in __str__ and __repr__</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.utils.APDU._getdata">
<code class="descname">_getdata</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.APDU._getdata" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.utils.APDU._setbyte">
<code class="descname">_setbyte</code><span class="sig-paren">(</span><em>name</em>, <em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.APDU._setbyte" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.utils.APDU._setdata">
<code class="descname">_setdata</code><span class="sig-paren">(</span><em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.APDU._setdata" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.utils.APDU.data">
<code class="descname">data</code><a class="headerlink" href="#virtualsmartcard.utils.APDU.data" title="Permalink to this definition"></a></dt>
<dd><p>The data contents of this APDU</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="virtualsmartcard.utils.C_APDU">
<em class="property">class </em><code class="descclassname">virtualsmartcard.utils.</code><code class="descname">C_APDU</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.C_APDU" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#virtualsmartcard.utils.APDU" title="virtualsmartcard.utils.APDU"><code class="xref py py-class docutils literal"><span class="pre">virtualsmartcard.utils.APDU</span></code></a></p>
<p>Class for a command APDU</p>
<dl class="attribute">
<dt id="virtualsmartcard.utils.C_APDU.CLA">
<code class="descname">CLA</code><a class="headerlink" href="#virtualsmartcard.utils.C_APDU.CLA" title="Permalink to this definition"></a></dt>
<dd><p>The CLA attribute of the APDU</p>
</dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.utils.C_APDU.INS">
<code class="descname">INS</code><a class="headerlink" href="#virtualsmartcard.utils.C_APDU.INS" title="Permalink to this definition"></a></dt>
<dd><p>The INS attribute of the APDU</p>
</dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.utils.C_APDU.Lc">
<code class="descname">Lc</code><a class="headerlink" href="#virtualsmartcard.utils.C_APDU.Lc" title="Permalink to this definition"></a></dt>
<dd><p>The Lc attribute of the APDU</p>
</dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.utils.C_APDU.Le">
<code class="descname">Le</code><a class="headerlink" href="#virtualsmartcard.utils.C_APDU.Le" title="Permalink to this definition"></a></dt>
<dd><p>The Le attribute of the APDU</p>
</dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.utils.C_APDU.P1">
<code class="descname">P1</code><a class="headerlink" href="#virtualsmartcard.utils.C_APDU.P1" title="Permalink to this definition"></a></dt>
<dd><p>The P1 attribute of the APDU</p>
</dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.utils.C_APDU.P2">
<code class="descname">P2</code><a class="headerlink" href="#virtualsmartcard.utils.C_APDU.P2" title="Permalink to this definition"></a></dt>
<dd><p>The P2 attribute of the APDU</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.utils.C_APDU._deldata">
<code class="descname">_deldata</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.C_APDU._deldata" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.utils.C_APDU._format_fields">
<code class="descname">_format_fields</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.C_APDU._format_fields" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.utils.C_APDU._format_parts">
<code class="descname">_format_parts</code><span class="sig-paren">(</span><em>fields</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.C_APDU._format_parts" title="Permalink to this definition"></a></dt>
<dd><p>utility function to be used in __str__ and __repr__</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.utils.C_APDU._getdata">
<code class="descname">_getdata</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.C_APDU._getdata" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.utils.C_APDU._setbyte">
<code class="descname">_setbyte</code><span class="sig-paren">(</span><em>name</em>, <em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.C_APDU._setbyte" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.utils.C_APDU._setdata">
<code class="descname">_setdata</code><span class="sig-paren">(</span><em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.C_APDU._setdata" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.utils.C_APDU.case">
<code class="descname">case</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.C_APDU.case" title="Permalink to this definition"></a></dt>
<dd><p>Return 1, 2, 3 or 4, depending on which ISO case we represent.</p>
</dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.utils.C_APDU.cla">
<code class="descname">cla</code><a class="headerlink" href="#virtualsmartcard.utils.C_APDU.cla" title="Permalink to this definition"></a></dt>
<dd><p>The CLA attribute of the APDU</p>
</dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.utils.C_APDU.data">
<code class="descname">data</code><a class="headerlink" href="#virtualsmartcard.utils.C_APDU.data" title="Permalink to this definition"></a></dt>
<dd><p>The data contents of this APDU</p>
</dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.utils.C_APDU.effective_Le">
<code class="descname">effective_Le</code><a class="headerlink" href="#virtualsmartcard.utils.C_APDU.effective_Le" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.utils.C_APDU.ins">
<code class="descname">ins</code><a class="headerlink" href="#virtualsmartcard.utils.C_APDU.ins" title="Permalink to this definition"></a></dt>
<dd><p>The INS attribute of the APDU</p>
</dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.utils.C_APDU.lc">
<code class="descname">lc</code><a class="headerlink" href="#virtualsmartcard.utils.C_APDU.lc" title="Permalink to this definition"></a></dt>
<dd><p>The Lc attribute of the APDU</p>
</dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.utils.C_APDU.le">
<code class="descname">le</code><a class="headerlink" href="#virtualsmartcard.utils.C_APDU.le" title="Permalink to this definition"></a></dt>
<dd><p>The Le attribute of the APDU</p>
</dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.utils.C_APDU.p1">
<code class="descname">p1</code><a class="headerlink" href="#virtualsmartcard.utils.C_APDU.p1" title="Permalink to this definition"></a></dt>
<dd><p>The P1 attribute of the APDU</p>
</dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.utils.C_APDU.p2">
<code class="descname">p2</code><a class="headerlink" href="#virtualsmartcard.utils.C_APDU.p2" title="Permalink to this definition"></a></dt>
<dd><p>The P2 attribute of the APDU</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.utils.C_APDU.parse">
<code class="descname">parse</code><span class="sig-paren">(</span><em>apdu</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.C_APDU.parse" title="Permalink to this definition"></a></dt>
<dd><p>Parse a full command APDU and assign the values to our object,
overwriting whatever there was.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.utils.C_APDU.render">
<code class="descname">render</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.C_APDU.render" title="Permalink to this definition"></a></dt>
<dd><p>Return this APDU as a binary string</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="virtualsmartcard.utils.R_APDU">
<em class="property">class </em><code class="descclassname">virtualsmartcard.utils.</code><code class="descname">R_APDU</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.R_APDU" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#virtualsmartcard.utils.APDU" title="virtualsmartcard.utils.APDU"><code class="xref py py-class docutils literal"><span class="pre">virtualsmartcard.utils.APDU</span></code></a></p>
<p>Class for a response APDU</p>
<dl class="attribute">
<dt id="virtualsmartcard.utils.R_APDU.SW">
<code class="descname">SW</code><a class="headerlink" href="#virtualsmartcard.utils.R_APDU.SW" title="Permalink to this definition"></a></dt>
<dd><p>The Status Word of this response APDU</p>
</dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.utils.R_APDU.SW1">
<code class="descname">SW1</code><a class="headerlink" href="#virtualsmartcard.utils.R_APDU.SW1" title="Permalink to this definition"></a></dt>
<dd><p>The SW1 attribute of the APDU</p>
</dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.utils.R_APDU.SW2">
<code class="descname">SW2</code><a class="headerlink" href="#virtualsmartcard.utils.R_APDU.SW2" title="Permalink to this definition"></a></dt>
<dd><p>The SW2 attribute of the APDU</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.utils.R_APDU._deldata">
<code class="descname">_deldata</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.R_APDU._deldata" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.utils.R_APDU._format_fields">
<code class="descname">_format_fields</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.R_APDU._format_fields" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.utils.R_APDU._format_parts">
<code class="descname">_format_parts</code><span class="sig-paren">(</span><em>fields</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.R_APDU._format_parts" title="Permalink to this definition"></a></dt>
<dd><p>utility function to be used in __str__ and __repr__</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.utils.R_APDU._getdata">
<code class="descname">_getdata</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.R_APDU._getdata" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.utils.R_APDU._getsw">
<code class="descname">_getsw</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.R_APDU._getsw" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.utils.R_APDU._setbyte">
<code class="descname">_setbyte</code><span class="sig-paren">(</span><em>name</em>, <em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.R_APDU._setbyte" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.utils.R_APDU._setdata">
<code class="descname">_setdata</code><span class="sig-paren">(</span><em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.R_APDU._setdata" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.utils.R_APDU._setsw">
<code class="descname">_setsw</code><span class="sig-paren">(</span><em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.R_APDU._setsw" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.utils.R_APDU.data">
<code class="descname">data</code><a class="headerlink" href="#virtualsmartcard.utils.R_APDU.data" title="Permalink to this definition"></a></dt>
<dd><p>The data contents of this APDU</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.utils.R_APDU.parse">
<code class="descname">parse</code><span class="sig-paren">(</span><em>apdu</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.R_APDU.parse" title="Permalink to this definition"></a></dt>
<dd><p>Parse a full response APDU and assign the values to our object,
overwriting whatever there was.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.utils.R_APDU.render">
<code class="descname">render</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.R_APDU.render" title="Permalink to this definition"></a></dt>
<dd><p>Return this APDU as a binary string</p>
</dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.utils.R_APDU.sw">
<code class="descname">sw</code><a class="headerlink" href="#virtualsmartcard.utils.R_APDU.sw" title="Permalink to this definition"></a></dt>
<dd><p>The Status Word of this response APDU</p>
</dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.utils.R_APDU.sw1">
<code class="descname">sw1</code><a class="headerlink" href="#virtualsmartcard.utils.R_APDU.sw1" title="Permalink to this definition"></a></dt>
<dd><p>The SW1 attribute of the APDU</p>
</dd></dl>
<dl class="attribute">
<dt id="virtualsmartcard.utils.R_APDU.sw2">
<code class="descname">sw2</code><a class="headerlink" href="#virtualsmartcard.utils.R_APDU.sw2" title="Permalink to this definition"></a></dt>
<dd><p>The SW2 attribute of the APDU</p>
</dd></dl>
</dd></dl>
<dl class="function">
<dt id="virtualsmartcard.utils._make_byte_property">
<code class="descclassname">virtualsmartcard.utils.</code><code class="descname">_make_byte_property</code><span class="sig-paren">(</span><em>prop</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils._make_byte_property" title="Permalink to this definition"></a></dt>
<dd><p>Make a byte property(). This is meta code.</p>
</dd></dl>
<dl class="function">
<dt id="virtualsmartcard.utils._unformat_hexdump">
<code class="descclassname">virtualsmartcard.utils.</code><code class="descname">_unformat_hexdump</code><span class="sig-paren">(</span><em>dump</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils._unformat_hexdump" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="virtualsmartcard.utils.hexdump">
<code class="descclassname">virtualsmartcard.utils.</code><code class="descname">hexdump</code><span class="sig-paren">(</span><em>data</em>, <em>indent=0</em>, <em>short=False</em>, <em>linelen=16</em>, <em>offset=0</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.hexdump" title="Permalink to this definition"></a></dt>
<dd><p>Generates a nice hexdump of data and returns it. Consecutive lines will
be indented with indent spaces. When short is true, will instead generate
hexdump without adresses and on one line.</p>
<p>Examples:
hexdump(&#8216;A&#8217;) -&gt; &#8216;0000: 00 41 .A &#8216;
hexdump(&#8216;A&#8217;, short=True) -&gt; &#8216;00 41 (.A)&#8217;</p>
</dd></dl>
<dl class="function">
<dt id="virtualsmartcard.utils.inttostring">
<code class="descclassname">virtualsmartcard.utils.</code><code class="descname">inttostring</code><span class="sig-paren">(</span><em>i</em>, <em>length=None</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.inttostring" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="virtualsmartcard.utils.parse_status">
<code class="descclassname">virtualsmartcard.utils.</code><code class="descname">parse_status</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.parse_status" title="Permalink to this definition"></a></dt>
<dd><p>Parses the Response APDU of a GetStatus command.</p>
</dd></dl>
<dl class="function">
<dt id="virtualsmartcard.utils.stringtoint">
<code class="descclassname">virtualsmartcard.utils.</code><code class="descname">stringtoint</code><span class="sig-paren">(</span><em>str</em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.utils.stringtoint" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
&copy; Copyright 2009-2016 by Dominik Oepen and Frank Morgner.<br/>
</p>
</div>
</footer>
</body>
</html>