regenerated documentation

This commit is contained in:
Frank Morgner
2021-04-28 02:13:40 +02:00
parent 29a818c69a
commit 27b3dfb62b
216 changed files with 26154 additions and 24712 deletions

View File

@@ -1,45 +1,29 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SmartcardSAM Module &mdash; vsmartcard 2017-01-16 documentation</title>
<link rel="stylesheet" href="../../_static/basic.css" type="text/css" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>SmartcardSAM Module &#8212; vsmartcard 2021-04-28 documentation</title>
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/bootswatch-3.3.4/flatly/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="../../_static/bootstrap-sphinx.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../',
VERSION: '2017-01-16',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<script type="text/javascript" src="../../_static/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="../../_static/js/jquery-fix.js"></script>
<script type="text/javascript" src="../../_static/bootstrap-3.3.4/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../../_static/bootstrap-sphinx.js"></script>
<link rel="stylesheet" type="text/css" href="../../_static/graphviz.css" />
<script id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/js/jquery-1.11.0.min.js"></script>
<script src="../../_static/js/jquery-fix.js"></script>
<script src="../../_static/bootstrap-3.3.7/js/bootstrap.min.js"></script>
<script src="../../_static/bootstrap-sphinx.js"></script>
<link rel="shortcut icon" href="../../_static/chip.ico"/>
<link rel="top" title="vsmartcard 2017-01-16 documentation" href="../../index.html" />
<link rel="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" />
<link rel="search" title="Search" href="../../search.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>
</head><body>
<a href="https://github.com/frankmorgner/vsmartcard"
class="visible-desktop hidden-xs"><img
@@ -90,8 +74,8 @@
<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 class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../api.html">Creating a Virtual Smart Card</a></li>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../api.html">Creating a Virtual Smart Card</a></li>
</ul>
</ul>
</li>
@@ -114,14 +98,6 @@
<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>
@@ -151,292 +127,281 @@
<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"/>
<div class="graphviz"><img src="../../_images/inheritance-f008352fda418a6e639df3493492ecf2a1976c1b.png" alt="Inheritance diagram of virtualsmartcard.SmartcardSAM" usemap="#inheritance8b3e5dd7ee" class="inheritance graphviz" /></div>
<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">
<area shape="rect" id="node1" href="#virtualsmartcard.SmartcardSAM.SAM" target="_top" title="This class is used to store the data needed by the SAM." alt="" coords="5,5,271,31"/>
</map><span class="target" id="module-virtualsmartcard.SmartcardSAM"></span><dl class="py class">
<dt id="virtualsmartcard.SmartcardSAM.SAM">
<em class="property">class </em><tt class="descclassname">virtualsmartcard.SmartcardSAM.</tt><tt class="descname">SAM</tt><big>(</big><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><big>)</big><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">virtualsmartcard.SmartcardSAM.</span></code><code class="sig-name descname"><span class="pre">SAM</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="pre">PIN</span></em>, <em class="sig-param"><span class="pre">cardNumber</span></em>, <em class="sig-param"><span class="pre">mf=None</span></em>, <em class="sig-param"><span class="pre">cardSecret=None</span></em>, <em class="sig-param"><span class="pre">default_se=&lt;class</span> <span class="pre">'virtualsmartcard.SEutils.Security_Environment'&gt;</span></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 notranslate"><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">
<dl class="py method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.FSdecrypt">
<tt class="descname">FSdecrypt</tt><big>(</big><em>data</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.FSdecrypt" title="Permalink to this definition"></a></dt>
<code class="sig-name descname"><span class="pre">FSdecrypt</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span></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">
<dl class="py method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.FSencrypt">
<tt class="descname">FSencrypt</tt><big>(</big><em>data</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.FSencrypt" title="Permalink to this definition"></a></dt>
<code class="sig-name descname"><span class="pre">FSencrypt</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span></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">
<dl class="py method">
<dt id="virtualsmartcard.SmartcardSAM.SAM._get_referenced_key">
<tt class="descname">_get_referenced_key</tt><big>(</big><em>p1</em>, <em>p2</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM._get_referenced_key" title="Permalink to this definition"></a></dt>
<code class="sig-name descname"><span class="pre">_get_referenced_key</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">p1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p2</span></span></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">
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>p1</strong> Specifies the algorithm to use.</p></li>
<li><p><strong>p2</strong> <p>Specifies a reference to the key to be used for encryption.</p>
<table class="docutils align-default">
<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%" />
<col style="width: 3%" />
<col style="width: 3%" />
<col style="width: 3%" />
<col style="width: 3%" />
<col style="width: 3%" />
<col style="width: 3%" />
<col style="width: 3%" />
<col style="width: 3%" />
<col style="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>
<thead>
<tr class="row-odd"><th class="head"><p>b8</p></th>
<th class="head"><p>b7</p></th>
<th class="head"><p>b6</p></th>
<th class="head"><p>b5</p></th>
<th class="head"><p>b4</p></th>
<th class="head"><p>b3</p></th>
<th class="head"><p>b2</p></th>
<th class="head"><p>b1</p></th>
<th class="head"><p>Meaning</p></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>
<tbody>
<tr class="row-even"><td><p>0</p></td>
<td><p>0</p></td>
<td><p>0</p></td>
<td><p>0</p></td>
<td><p>0</p></td>
<td><p>0</p></td>
<td><p>0</p></td>
<td><p>0</p></td>
<td><p>No information is given</p></td>
</tr>
<tr class="row-odd"><td>0</td>
<td><ul class="first last">
<tr class="row-odd"><td><p>0</p></td>
<td><ul>
<li></li>
</ul>
</td>
<td><ul class="first last">
<td><ul>
<li></li>
</ul>
</td>
<td><ul class="first last">
<td><ul>
<li></li>
</ul>
</td>
<td><ul class="first last">
<td><ul>
<li></li>
</ul>
</td>
<td><ul class="first last">
<td><ul>
<li></li>
</ul>
</td>
<td><ul class="first last">
<td><ul>
<li></li>
</ul>
</td>
<td><ul class="first last">
<td><ul>
<li></li>
</ul>
</td>
<td>Global reference data(e.g. MF specific key)</td>
<td><p>Global reference data(e.g. MF specific key)</p></td>
</tr>
<tr class="row-even"><td>1</td>
<td><ul class="first last">
<tr class="row-even"><td><p>1</p></td>
<td><ul>
<li></li>
</ul>
</td>
<td><ul class="first last">
<td><ul>
<li></li>
</ul>
</td>
<td><ul class="first last">
<td><ul>
<li></li>
</ul>
</td>
<td><ul class="first last">
<td><ul>
<li></li>
</ul>
</td>
<td><ul class="first last">
<td><ul>
<li></li>
</ul>
</td>
<td><ul class="first last">
<td><ul>
<li></li>
</ul>
</td>
<td><ul class="first last">
<td><ul>
<li></li>
</ul>
</td>
<td>Specific reference data(e.g. DF specific
key)</td>
<td><p>Specific reference data(e.g. DF specific
key)</p></td>
</tr>
<tr class="row-odd"><td><ul class="first last">
<tr class="row-odd"><td><ul>
<li></li>
</ul>
</td>
<td><ul class="first last">
<td><ul>
<li></li>
</ul>
</td>
<td><ul class="first last">
<td><ul>
<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>
<td><p>x</p></td>
<td><p>x</p></td>
<td><p>x</p></td>
<td><p>x</p></td>
<td><p>x</p></td>
<td><p>Number of the secret</p></td>
</tr>
</tbody>
</table>
<p>Any other value RFU</p>
</li>
</p></li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dl class="py method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.change_reference_data">
<tt class="descname">change_reference_data</tt><big>(</big><em>p1</em>, <em>p2</em>, <em>data</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.change_reference_data" title="Permalink to this definition"></a></dt>
<code class="sig-name descname"><span class="pre">change_reference_data</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">p1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span></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">
<dl class="py method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.erase_SE">
<tt class="descname">erase_SE</tt><big>(</big><em>SEID</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.erase_SE" title="Permalink to this definition"></a></dt>
<code class="sig-name descname"><span class="pre">erase_SE</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">SEID</span></span></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">
<dl class="py method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.external_authenticate">
<tt class="descname">external_authenticate</tt><big>(</big><em>p1</em>, <em>p2</em>, <em>data</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.external_authenticate" title="Permalink to this definition"></a></dt>
<code class="sig-name descname"><span class="pre">external_authenticate</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">p1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span></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">
<dl class="py method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.generate_public_key_pair">
<tt class="descname">generate_public_key_pair</tt><big>(</big><em>p1</em>, <em>p2</em>, <em>data</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.generate_public_key_pair" title="Permalink to this definition"></a></dt>
<code class="sig-name descname"><span class="pre">generate_public_key_pair</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">p1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span></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">
<dl class="py method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.get_card_number">
<tt class="descname">get_card_number</tt><big>(</big><big>)</big><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.get_card_number" title="Permalink to this definition"></a></dt>
<code class="sig-name descname"><span class="pre">get_card_number</span></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">
<dl class="py method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.get_challenge">
<tt class="descname">get_challenge</tt><big>(</big><em>p1</em>, <em>p2</em>, <em>data</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.get_challenge" title="Permalink to this definition"></a></dt>
<code class="sig-name descname"><span class="pre">get_challenge</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">p1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span></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">
<dl class="py method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.internal_authenticate">
<tt class="descname">internal_authenticate</tt><big>(</big><em>p1</em>, <em>p2</em>, <em>data</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.internal_authenticate" title="Permalink to this definition"></a></dt>
<code class="sig-name descname"><span class="pre">internal_authenticate</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">p1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span></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">
<dl class="py method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.manage_security_environment">
<tt class="descname">manage_security_environment</tt><big>(</big><em>p1</em>, <em>p2</em>, <em>data</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.manage_security_environment" title="Permalink to this definition"></a></dt>
<code class="sig-name descname"><span class="pre">manage_security_environment</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">p1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span></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">
<dl class="py method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.mutual_authenticate">
<tt class="descname">mutual_authenticate</tt><big>(</big><em>p1</em>, <em>p2</em>, <em>mutual_challenge</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.mutual_authenticate" title="Permalink to this definition"></a></dt>
<code class="sig-name descname"><span class="pre">mutual_authenticate</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">p1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mutual_challenge</span></span></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;
Terminal Challenge | Card Challenge | Card number
and checks it for validity. If the challenge is successful
the card encrypts &#8216;Card Challenge | Terminal challenge&#8217; and
the card encrypts Card Challenge | Terminal challenge and
returns this value</p>
</dd></dl>
<dl class="method">
<dl class="py method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.parse_SM_CAPDU">
<tt class="descname">parse_SM_CAPDU</tt><big>(</big><em>CAPDU</em>, <em>header_authentication</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.parse_SM_CAPDU" title="Permalink to this definition"></a></dt>
<code class="sig-name descname"><span class="pre">parse_SM_CAPDU</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">CAPDU</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">header_authentication</span></span></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">
<dl class="py method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.perform_security_operation">
<tt class="descname">perform_security_operation</tt><big>(</big><em>p1</em>, <em>p2</em>, <em>data</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.perform_security_operation" title="Permalink to this definition"></a></dt>
<code class="sig-name descname"><span class="pre">perform_security_operation</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">p1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span></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">
<dl class="py method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.protect_result">
<tt class="descname">protect_result</tt><big>(</big><em>sw</em>, <em>unprotected_result</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.protect_result" title="Permalink to this definition"></a></dt>
<code class="sig-name descname"><span class="pre">protect_result</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sw</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">unprotected_result</span></span></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">
<dl class="py method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.restore_SE">
<tt class="descname">restore_SE</tt><big>(</big><em>SEID</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.restore_SE" title="Permalink to this definition"></a></dt>
<code class="sig-name descname"><span class="pre">restore_SE</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">SEID</span></span></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">
<dl class="py method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.set_MF">
<tt class="descname">set_MF</tt><big>(</big><em>mf</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.set_MF" title="Permalink to this definition"></a></dt>
<code class="sig-name descname"><span class="pre">set_MF</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">mf</span></span></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">
<dl class="py method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.set_asym_algorithm">
<tt class="descname">set_asym_algorithm</tt><big>(</big><em>cipher</em>, <em>keytype</em><big>)</big><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>
<code class="sig-name descname"><span class="pre">set_asym_algorithm</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cipher</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">keytype</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.set_asym_algorithm" title="Permalink to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cipher</strong> Public/private key object from used for encryption</p></li>
<li><p><strong>keytype</strong> Type of the public key (e.g. RSA, DSA)</p></li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dl class="py method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.store_SE">
<tt class="descname">store_SE</tt><big>(</big><em>SEID</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.store_SE" title="Permalink to this definition"></a></dt>
<code class="sig-name descname"><span class="pre">store_SE</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">SEID</span></span></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">
<dl class="py method">
<dt id="virtualsmartcard.SmartcardSAM.SAM.verify">
<tt class="descname">verify</tt><big>(</big><em>p1</em>, <em>p2</em>, <em>PIN</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.SAM.verify" title="Permalink to this definition"></a></dt>
<code class="sig-name descname"><span class="pre">verify</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">p1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">PIN</span></span></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>
@@ -444,9 +409,9 @@ equals zero, block the card until reset with correct PUK</p>
</dd></dl>
<dl class="function">
<dl class="py function">
<dt id="virtualsmartcard.SmartcardSAM.get_referenced_cipher">
<tt class="descclassname">virtualsmartcard.SmartcardSAM.</tt><tt class="descname">get_referenced_cipher</tt><big>(</big><em>p1</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SmartcardSAM.get_referenced_cipher" title="Permalink to this definition"></a></dt>
<code class="sig-prename descclassname"><span class="pre">virtualsmartcard.SmartcardSAM.</span></code><code class="sig-name descname"><span class="pre">get_referenced_cipher</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">p1</span></span></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>
@@ -465,7 +430,7 @@ string that is understood by CryptoUtils.py functions</p>
</p>
<p>
&copy; Copyright 2009-2017 by Dominik Oepen and Frank Morgner.<br/>
&copy; Copyright 2009-2021 by Dominik Oepen and Frank Morgner.<br/>
</p>
</div>
</footer>