Files
vsmartcard/docs/virtualsmartcard/api/virtualsmartcard.cards.cryptoflex.html
2021-04-28 02:13:40 +02:00

1527 lines
101 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>cryptoflex Module &#8212; vsmartcard 2021-04-28 documentation</title>
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/bootstrap-sphinx.css" type="text/css" />
<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="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>
<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="../../TCardEmulator/README.html">Tizen Smart Card Emulator</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pcsc-relay/README.html">PC/SC Relay</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../ccid/README.html">USB CCID Emulator</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../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="#">cryptoflex Module</a></li>
</ul>
</ul>
</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="cryptoflex-module">
<h1>cryptoflex Module<a class="headerlink" href="#cryptoflex-module" title="Permalink to this headline"></a></h1>
<div class="graphviz"><img src="../../_images/inheritance-7c76a7e8744cca7867d24d6422b52bf99bf0f715.png" alt="Inheritance diagram of virtualsmartcard.cards.cryptoflex" usemap="#inheritance645263d8d9" class="inheritance graphviz" /></div>
<map id="inheritance645263d8d9" name="inheritance645263d8d9">
<area shape="rect" id="node1" href="virtualsmartcard.SEutils.html#virtualsmartcard.SEutils.Security_Environment" target="_top" title="virtualsmartcard.SEutils.Security_Environment" alt="" coords="5,79,173,93"/>
<area shape="rect" id="node11" href="#virtualsmartcard.cards.cryptoflex.CryptoflexSE" target="_top" title="virtualsmartcard.cards.cryptoflex.CryptoflexSE" alt="" coords="204,79,372,93"/>
<area shape="rect" id="node2" href="virtualsmartcard.SmartcardFilesystem.html#virtualsmartcard.SmartcardFilesystem.DF" target="_top" title="Class for a dedicated file" alt="" coords="212,54,364,67"/>
<area shape="rect" id="node4" href="virtualsmartcard.SmartcardFilesystem.html#virtualsmartcard.SmartcardFilesystem.MF" target="_top" title="Class for a master file" alt="" coords="409,54,562,67"/>
<area shape="rect" id="node3" href="virtualsmartcard.SmartcardFilesystem.html#virtualsmartcard.SmartcardFilesystem.File" target="_top" title="Template class for a smartcard file." alt="" coords="12,54,166,67"/>
<area shape="rect" id="node8" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF" target="_top" title="virtualsmartcard.cards.cryptoflex.CryptoflexMF" alt="" coords="595,54,765,67"/>
<area shape="rect" id="node5" href="virtualsmartcard.SmartcardSAM.html#virtualsmartcard.SmartcardSAM.SAM" target="_top" title="This class is used to store the data needed by the SAM." alt="" coords="20,28,158,41"/>
<area shape="rect" id="node10" href="#virtualsmartcard.cards.cryptoflex.CryptoflexSAM" target="_top" title="virtualsmartcard.cards.cryptoflex.CryptoflexSAM" alt="" coords="200,28,376,41"/>
<area shape="rect" id="node6" href="virtualsmartcard.VirtualSmartcard.html#virtualsmartcard.VirtualSmartcard.Iso7816OS" target="_top" title="virtualsmartcard.VirtualSmartcard.Iso7816OS" alt="" coords="206,3,370,16"/>
<area shape="rect" id="node9" href="#virtualsmartcard.cards.cryptoflex.CryptoflexOS" target="_top" title="virtualsmartcard.cards.cryptoflex.CryptoflexOS" alt="" coords="401,3,570,16"/>
<area shape="rect" id="node7" href="virtualsmartcard.VirtualSmartcard.html#virtualsmartcard.VirtualSmartcard.SmartcardOS" target="_top" title="Base class for a smart card OS" alt="" coords="3,3,175,16"/>
</map><span class="target" id="module-virtualsmartcard.cards.cryptoflex"></span><dl class="py class">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">virtualsmartcard.cards.cryptoflex.</span></code><code class="sig-name descname"><span class="pre">CryptoflexMF</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filedescriptor</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">56</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lifecycle</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">5</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">simpletlv_data</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bertlv_data</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dfname</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="virtualsmartcard.SmartcardFilesystem.html#virtualsmartcard.SmartcardFilesystem.MF" title="virtualsmartcard.SmartcardFilesystem.MF"><code class="xref py py-class docutils literal notranslate"><span class="pre">virtualsmartcard.SmartcardFilesystem.MF</span></code></a></p>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF._selectFile">
<code class="sig-name descname"><span class="pre">_selectFile</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.cards.cryptoflex.CryptoflexMF._selectFile" title="Permalink to this definition"></a></dt>
<dd><p>Returns the file specified by p1 and data from the select
file command APDU.</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.append">
<code class="sig-name descname"><span class="pre">append</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">file</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.append" title="Permalink to this definition"></a></dt>
<dd><p>Appends file to the content of the DF.</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.appendRecord">
<code class="sig-name descname"><span class="pre">appendRecord</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.cards.cryptoflex.CryptoflexMF.appendRecord" title="Permalink to this definition"></a></dt>
<dd><p>Function for instruction 0xe2. Takes the parameter bytes p1, p2 as
integers and data as binary string.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the status bytes as two byte long integer and the response
data as binary string.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.appendrecord">
<code class="sig-name descname"><span class="pre">appendrecord</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">argz</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.appendrecord" title="Permalink to this definition"></a></dt>
<dd><p>Only a template, will raise an error.</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.bertlv_data">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">bertlv_data</span></code><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.bertlv_data" title="Permalink to this definition"></a></dt>
<dd><p>list of (tag, length, value)-tuples of BER-TLV coded data objects (encrypted)</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.content">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">content</span></code><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.content" title="Permalink to this definition"></a></dt>
<dd><p>list of files of the DF</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.create">
<em class="property"><span class="pre">static</span> </em><code class="sig-name descname"><span class="pre">create</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.cards.cryptoflex.CryptoflexMF.create" title="Permalink to this definition"></a></dt>
<dd><p>Creates and returns a list of files according to the parameters of a
create file command.</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.createFile">
<code class="sig-name descname"><span class="pre">createFile</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.cards.cryptoflex.CryptoflexMF.createFile" title="Permalink to this definition"></a></dt>
<dd><p>Function for instruction 0xe0. Takes the parameter bytes p1, p2 as
integers and data as binary string.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the status bytes as two byte long integer and the response
data as binary string.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.current">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">current</span></code><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.current" title="Permalink to this definition"></a></dt>
<dd><p>the currently selected file</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.currentDF">
<code class="sig-name descname"><span class="pre">currentDF</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.currentDF" title="Permalink to this definition"></a></dt>
<dd><p>Returns the current DF.</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.currentEF">
<code class="sig-name descname"><span class="pre">currentEF</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.currentEF" title="Permalink to this definition"></a></dt>
<dd><p>Returns the current EF or None if not available.</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.data">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">data</span></code><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.data" title="Permalink to this definition"></a></dt>
<dd><p>unknown</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.dataObjectHandlingDecodeEncapsulated">
<code class="sig-name descname"><span class="pre">dataObjectHandlingDecodeEncapsulated</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.cards.cryptoflex.CryptoflexMF.dataObjectHandlingDecodeEncapsulated" title="Permalink to this definition"></a></dt>
<dd><p>Decodes p1, p2 and data from a data object handling command (i.
e. get/put data) with <em>odd</em> instruction code.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the specified file, True if the following list regards
SIMPLE-TLV data objects False otherwise and a list of
(tag, length, value)-tuples.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.dataObjectHandlingDecodePlain">
<code class="sig-name descname"><span class="pre">dataObjectHandlingDecodePlain</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.cards.cryptoflex.CryptoflexMF.dataObjectHandlingDecodePlain" title="Permalink to this definition"></a></dt>
<dd><p>Decodes p1, p2 and data from a data object handling command (i.
e. get/put data) with <em>even</em> instruction code.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the specified file, True if the following list regards
SIMPLE-TLV data objects False otherwise and a list of
(tag, length, value)-tuples.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.dataUnitsDecodeEncapsulated">
<code class="sig-name descname"><span class="pre">dataUnitsDecodeEncapsulated</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.cards.cryptoflex.CryptoflexMF.dataUnitsDecodeEncapsulated" title="Permalink to this definition"></a></dt>
<dd><p>Decodes p1, p2 and data from a data unit command (i. e.
read/write/update/search/erase binary) with <em>odd</em> instruction code.</p>
<dl class="simple">
<dt>:returns the specified TransparentStructureEF, a list of offsets and a</dt><dd><p>list of data strings.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.dataUnitsDecodePlain">
<code class="sig-name descname"><span class="pre">dataUnitsDecodePlain</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.cards.cryptoflex.CryptoflexMF.dataUnitsDecodePlain" title="Permalink to this definition"></a></dt>
<dd><p>Decodes p1, p2 and data from a data unit command (i. e.
read/write/update/search/erase binary) with <em>even</em> instruction code.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the specified TransparentStructureEF, a list of offsets and a
list of data strings.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.decrypt">
<code class="sig-name descname"><span class="pre">decrypt</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</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.cards.cryptoflex.CryptoflexMF.decrypt" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.deleteFile">
<code class="sig-name descname"><span class="pre">deleteFile</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.cards.cryptoflex.CryptoflexMF.deleteFile" title="Permalink to this definition"></a></dt>
<dd><p>Function for instruction 0xe4. Takes the parameter bytes p1, p2 as
integers and data as binary string.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the status bytes as two byte long integer and the response
data as binary string.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.dfname">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">dfname</span></code><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.dfname" title="Permalink to this definition"></a></dt>
<dd><p>string with up to 16 bytes. DF name,which can also be used as applicationidentifier.</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.encodeFileControlParameter">
<em class="property"><span class="pre">static</span> </em><code class="sig-name descname"><span class="pre">encodeFileControlParameter</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">file</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.encodeFileControlParameter" title="Permalink to this definition"></a></dt>
<dd><p>Returns a string of TLV-coded file control information of file. Note:
The result is not prepended with tag and length for neither TCP, FMD
nor FCI template.</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.encrypt">
<code class="sig-name descname"><span class="pre">encrypt</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</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.cards.cryptoflex.CryptoflexMF.encrypt" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.eraseBinaryEncapsulated">
<code class="sig-name descname"><span class="pre">eraseBinaryEncapsulated</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.cards.cryptoflex.CryptoflexMF.eraseBinaryEncapsulated" title="Permalink to this definition"></a></dt>
<dd><p>Function for instruction 0x0f. Takes the parameter bytes p1, p2 as
integers and data as binary string.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the status bytes as two byte long integer and the response
data as binary string.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.eraseBinaryPlain">
<code class="sig-name descname"><span class="pre">eraseBinaryPlain</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.cards.cryptoflex.CryptoflexMF.eraseBinaryPlain" title="Permalink to this definition"></a></dt>
<dd><p>Function for instruction 0x0e. Takes the parameter bytes p1, p2 as
integers and data as binary string.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the status bytes as two byte long integer and the response
data as binary string.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.eraseRecord">
<code class="sig-name descname"><span class="pre">eraseRecord</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.cards.cryptoflex.CryptoflexMF.eraseRecord" title="Permalink to this definition"></a></dt>
<dd><p>Function for instruction 0x0c. Takes the parameter bytes p1, p2 as
integers and data as binary string.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the status bytes as two byte long integer and the response
data as binary string.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.erasebinary">
<code class="sig-name descname"><span class="pre">erasebinary</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">argz</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.erasebinary" title="Permalink to this definition"></a></dt>
<dd><p>Only a template, will raise an error.</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.fid">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">fid</span></code><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.fid" title="Permalink to this definition"></a></dt>
<dd><p>file identifier</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.filedescriptor">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">filedescriptor</span></code><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.filedescriptor" title="Permalink to this definition"></a></dt>
<dd><p>file descriptor byte</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.firstSFT">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">firstSFT</span></code><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.firstSFT" title="Permalink to this definition"></a></dt>
<dd><p>string of length 1. The firstsoftware function table from thehistorical bytes.</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.getDataEncapsulated">
<code class="sig-name descname"><span class="pre">getDataEncapsulated</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.cards.cryptoflex.CryptoflexMF.getDataEncapsulated" title="Permalink to this definition"></a></dt>
<dd><p>Function for instruction 0xcb. Takes the parameter bytes p1, p2 as
integers and data as binary string.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the status bytes as two byte long integer and the response
data as binary string.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.getDataPlain">
<code class="sig-name descname"><span class="pre">getDataPlain</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.cards.cryptoflex.CryptoflexMF.getDataPlain" title="Permalink to this definition"></a></dt>
<dd><p>Function for instruction 0xca. Takes the parameter bytes p1, p2 as
integers and data as binary string.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the status bytes as two byte long integer and the response
data as binary string.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.getMF">
<code class="sig-name descname"><span class="pre">getMF</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.getMF" title="Permalink to this definition"></a></dt>
<dd><p>Return MF of the card that contains this file</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.getdata">
<code class="sig-name descname"><span class="pre">getdata</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">isSimpleTlv</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">requestedTL</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.getdata" title="Permalink to this definition"></a></dt>
<dd><p>Returns a string of either the files BER-TLV or the files SIMPLE-TLV
coded data objects depending on the bool isSimpleTlv. requestedTL
is a list of (tag, length)-tuples that specify which tags should be
returned in what size.</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.getpath">
<code class="sig-name descname"><span class="pre">getpath</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.getpath" title="Permalink to this definition"></a></dt>
<dd><p>Returns the path to this file beginning with the MFs fid.</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.lifecycle">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">lifecycle</span></code><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.lifecycle" title="Permalink to this definition"></a></dt>
<dd><p>life cycle byte</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.makeFirstSoftwareFunctionTable">
<em class="property"><span class="pre">static</span> </em><code class="sig-name descname"><span class="pre">makeFirstSoftwareFunctionTable</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">DFSelectionByFullDFName</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">DFSelectionByPartialDFName</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">DFSelectionByPath</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">DFSelectionByFID</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">DFSelectionByApplication_implicite</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ShortFIDSupported</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">RecordNumberSupported</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">RecordIdentifierSupported</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.makeFirstSoftwareFunctionTable" title="Permalink to this definition"></a></dt>
<dd><p>Returns a byte according to the first software function table from the
historical bytes of the card capabilities.</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.makeSecondSoftwareFunctionTable">
<em class="property"><span class="pre">static</span> </em><code class="sig-name descname"><span class="pre">makeSecondSoftwareFunctionTable</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">DCB</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.makeSecondSoftwareFunctionTable" title="Permalink to this definition"></a></dt>
<dd><p>The second software function table from the historical bytes contains
the data coding byte.</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.named_dfs">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">named_dfs</span></code><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.named_dfs" title="Permalink to this definition"></a></dt>
<dd><p>list of DFs with dfname specified</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.parent">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">parent</span></code><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.parent" title="Permalink to this definition"></a></dt>
<dd><p>parent DF</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.putDataEncapsulated">
<code class="sig-name descname"><span class="pre">putDataEncapsulated</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.cards.cryptoflex.CryptoflexMF.putDataEncapsulated" title="Permalink to this definition"></a></dt>
<dd><p>Function for instruction 0xdb. Takes the parameter bytes p1, p2 as
integers and data as binary string.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the status bytes as two byte long integer and the response
data as binary string.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.putDataPlain">
<code class="sig-name descname"><span class="pre">putDataPlain</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.cards.cryptoflex.CryptoflexMF.putDataPlain" title="Permalink to this definition"></a></dt>
<dd><p>Function for instruction 0xda. Takes the parameter bytes p1, p2 as
integers and data as binary string.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the status bytes as two byte long integer and the response
data as binary string.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.putdata">
<code class="sig-name descname"><span class="pre">putdata</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">isSimpleTlv</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">newtlvlist</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.putdata" title="Permalink to this definition"></a></dt>
<dd><p>Sets either the files BER-TLV or the files SIMPLE-TLV coded data
objects depending on the bool isSimpleTlv. newtlvlist is a list of
(tag, length, value)-tuples of new data.</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.readBinaryEncapsulated">
<code class="sig-name descname"><span class="pre">readBinaryEncapsulated</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.cards.cryptoflex.CryptoflexMF.readBinaryEncapsulated" title="Permalink to this definition"></a></dt>
<dd><p>Function for instruction 0xb1. Takes the parameter bytes p1, p2 as
integers and data as binary string.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the status bytes as two byte long integer and the response
data as binary string.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.readBinaryPlain">
<code class="sig-name descname"><span class="pre">readBinaryPlain</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.cards.cryptoflex.CryptoflexMF.readBinaryPlain" title="Permalink to this definition"></a></dt>
<dd><p>Function for instruction 0xb0. Takes the parameter bytes p1, p2 as
integers and data as binary string.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the status bytes as two byte long integer and the response
data as binary string.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.readRecordEncapsulated">
<code class="sig-name descname"><span class="pre">readRecordEncapsulated</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.cards.cryptoflex.CryptoflexMF.readRecordEncapsulated" title="Permalink to this definition"></a></dt>
<dd><p>Function for instruction 0xb3. Takes the parameter bytes p1, p2 as
integers and data as binary string.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the status bytes as two byte long integer and the response
data as binary string.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.readRecordPlain">
<code class="sig-name descname"><span class="pre">readRecordPlain</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.cards.cryptoflex.CryptoflexMF.readRecordPlain" title="Permalink to this definition"></a></dt>
<dd><p>Function for instruction 0xb2. Takes the parameter bytes p1, p2 as
integers and data as binary string.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the status bytes as two byte long integer and the response
data as binary string.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.readbinary">
<code class="sig-name descname"><span class="pre">readbinary</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">argz</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.readbinary" title="Permalink to this definition"></a></dt>
<dd><p>Only a template, will raise an error.</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.readrecord">
<code class="sig-name descname"><span class="pre">readrecord</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">argz</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.readrecord" title="Permalink to this definition"></a></dt>
<dd><p>Only a template, will raise an error.</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.recordHandlingDecode">
<code class="sig-name descname"><span class="pre">recordHandlingDecode</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.cards.cryptoflex.CryptoflexMF.recordHandlingDecode" title="Permalink to this definition"></a></dt>
<dd><p>Decodes p1 and p2 from a record handling command (i. e.
read/write/update/append/search/erase record).</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the specified RecordStructureEF, the number or identifier of
the record and a reference, that specifies which record to select
(i. e. the last 3 bits of p1).</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.remove">
<code class="sig-name descname"><span class="pre">remove</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">file</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.remove" title="Permalink to this definition"></a></dt>
<dd><p>Removes file from the content of the DF</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.searchBinaryEncapsulated">
<code class="sig-name descname"><span class="pre">searchBinaryEncapsulated</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.cards.cryptoflex.CryptoflexMF.searchBinaryEncapsulated" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.searchBinaryPlain">
<code class="sig-name descname"><span class="pre">searchBinaryPlain</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.cards.cryptoflex.CryptoflexMF.searchBinaryPlain" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.secondSFT">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">secondSFT</span></code><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.secondSFT" title="Permalink to this definition"></a></dt>
<dd><p>string of length 1. The secondsoftware function table from thehistorical bytes.</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.select">
<code class="sig-name descname"><span class="pre">select</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attribute</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">reference</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">index_current</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.select" title="Permalink to this definition"></a></dt>
<dd><p>Returns the first file of the DF, that has the attribute with the
specified value. For partial DF name selection you must specify the
first/last/next or previous occurence with reference and the index of
the current file index_current (-1 for None).</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.selectFile">
<code class="sig-name descname"><span class="pre">selectFile</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.cards.cryptoflex.CryptoflexMF.selectFile" title="Permalink to this definition"></a></dt>
<dd><p>Function for instruction 0xa4. Takes the parameter bytes p1, p2 as
integers and data as binary string. Returns the status bytes as two
byte long integer and the response data as binary string.</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.simpletlv_data">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">simpletlv_data</span></code><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.simpletlv_data" title="Permalink to this definition"></a></dt>
<dd><p>list of (tag, length, value)-tuples of SIMPLE-TLV coded data objects (encrypted)</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.updateBinaryEncapsulated">
<code class="sig-name descname"><span class="pre">updateBinaryEncapsulated</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.cards.cryptoflex.CryptoflexMF.updateBinaryEncapsulated" title="Permalink to this definition"></a></dt>
<dd><p>Function for instruction 0xd7. Takes the parameter bytes p1, p2 as
integers and data as binary string.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the status bytes as two byte long integer and the response
data as binary string.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.updateBinaryPlain">
<code class="sig-name descname"><span class="pre">updateBinaryPlain</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.cards.cryptoflex.CryptoflexMF.updateBinaryPlain" title="Permalink to this definition"></a></dt>
<dd><p>Function for instruction 0xd6. Takes the parameter bytes p1, p2 as
integers and data as binary string.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the status bytes as two byte long integer and the response
data as binary string.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.updateRecordEncapsulated">
<code class="sig-name descname"><span class="pre">updateRecordEncapsulated</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.cards.cryptoflex.CryptoflexMF.updateRecordEncapsulated" title="Permalink to this definition"></a></dt>
<dd><p>Function for instruction 0xdd. Takes the parameter bytes p1, p2 as
integers and data as binary string.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the status bytes as two byte long integer and the response
data as binary string.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.updateRecordPlain">
<code class="sig-name descname"><span class="pre">updateRecordPlain</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.cards.cryptoflex.CryptoflexMF.updateRecordPlain" title="Permalink to this definition"></a></dt>
<dd><p>Function for instruction 0xdc. Takes the parameter bytes p1, p2 as
integers and data as binary string.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the status bytes as two byte long integer and the response
data as binary string.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.updatebinary">
<code class="sig-name descname"><span class="pre">updatebinary</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">argz</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.updatebinary" title="Permalink to this definition"></a></dt>
<dd><p>Only a template, will raise an error.</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.updaterecord">
<code class="sig-name descname"><span class="pre">updaterecord</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">argz</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.updaterecord" title="Permalink to this definition"></a></dt>
<dd><p>Only a template, will raise an error.</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.writeBinaryEncapsulated">
<code class="sig-name descname"><span class="pre">writeBinaryEncapsulated</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.cards.cryptoflex.CryptoflexMF.writeBinaryEncapsulated" title="Permalink to this definition"></a></dt>
<dd><p>Function for instruction 0xd1. Takes the parameter bytes p1, p2 as
integers and data as binary string. Returns the status bytes as two
byte long integer and the response data as binary string.</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.writeBinaryPlain">
<code class="sig-name descname"><span class="pre">writeBinaryPlain</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.cards.cryptoflex.CryptoflexMF.writeBinaryPlain" title="Permalink to this definition"></a></dt>
<dd><p>Function for instruction 0xd0. Takes the parameter bytes p1, p2 as
integers and data as binary string.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the status bytes as two byte long integer and the response
data as binary string.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.writeRecord">
<code class="sig-name descname"><span class="pre">writeRecord</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.cards.cryptoflex.CryptoflexMF.writeRecord" title="Permalink to this definition"></a></dt>
<dd><p>Function for instruction 0xd2. Takes the parameter bytes p1, p2 as
integers and data as binary string.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the status bytes as two byte long integer and the response
data as binary string.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.writebinary">
<code class="sig-name descname"><span class="pre">writebinary</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">argz</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.writebinary" title="Permalink to this definition"></a></dt>
<dd><p>Only a template, will raise an error.</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexMF.writerecord">
<code class="sig-name descname"><span class="pre">writerecord</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">argz</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexMF.writerecord" title="Permalink to this definition"></a></dt>
<dd><p>Only a template, will raise an error.</p>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexOS">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">virtualsmartcard.cards.cryptoflex.</span></code><code class="sig-name descname"><span class="pre">CryptoflexOS</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">mf</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sam</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ins2handler</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">maxle</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">256</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexOS" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="virtualsmartcard.VirtualSmartcard.html#virtualsmartcard.VirtualSmartcard.Iso7816OS" title="virtualsmartcard.VirtualSmartcard.Iso7816OS"><code class="xref py py-class docutils literal notranslate"><span class="pre">virtualsmartcard.VirtualSmartcard.Iso7816OS</span></code></a></p>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexOS.SAM">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">SAM</span></code><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexOS.SAM" title="Permalink to this definition"></a></dt>
<dd><p>secure access module</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexOS.execute">
<code class="sig-name descname"><span class="pre">execute</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">msg</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexOS.execute" title="Permalink to this definition"></a></dt>
<dd><p>Returns response to the given APDU as string of characters</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>msg</strong> the APDU as string of characters</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexOS.formatResult">
<code class="sig-name descname"><span class="pre">formatResult</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ins</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">le</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sw</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexOS.formatResult" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexOS.getATR">
<code class="sig-name descname"><span class="pre">getATR</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexOS.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="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexOS.getResponse">
<code class="sig-name descname"><span class="pre">getResponse</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.cards.cryptoflex.CryptoflexOS.getResponse" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexOS.makeATR">
<em class="property"><span class="pre">static</span> </em><code class="sig-name descname"><span class="pre">makeATR</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexOS.makeATR" title="Permalink to this definition"></a></dt>
<dd><p>Calculate Answer to Reset (ATR) and returns the bitstring.</p>
<blockquote>
<div><ul class="simple">
<li><dl class="simple">
<dt>directConvention (bool): Whether to use direct convention or</dt><dd><p>inverse convention.</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>TAi, TBi, TCi (optional): Value between 0 and 0xff. Interface</dt><dd><p>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="simple">
<dt>T (optional): Value between 0 and 15. Transmission Protocol.</dt><dd><p>Note that if T is set, TAi/TBi/TCi for i&gt;T are
omitted.</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>histChars (optional): Bitstring with 0 &lt;= len(histChars) &lt;= 15.</dt><dd><p>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="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexOS.makeThirdSoftwareFunctionTable">
<em class="property"><span class="pre">static</span> </em><code class="sig-name descname"><span class="pre">makeThirdSoftwareFunctionTable</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">commandChainging</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">extendedLe</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">assignLogicalChannel</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">maximumChannels</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexOS.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="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexOS.mf">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">mf</span></code><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexOS.mf" title="Permalink to this definition"></a></dt>
<dd><p>master file</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexOS.powerDown">
<code class="sig-name descname"><span class="pre">powerDown</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexOS.powerDown" title="Permalink to this definition"></a></dt>
<dd><p>Powers down the card</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexOS.powerUp">
<code class="sig-name descname"><span class="pre">powerUp</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexOS.powerUp" title="Permalink to this definition"></a></dt>
<dd><p>Powers up the card</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexOS.reset">
<code class="sig-name descname"><span class="pre">reset</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexOS.reset" title="Permalink to this definition"></a></dt>
<dd><p>Performs a warm reset of the card (no power down)</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexOS.seekable">
<em class="property"><span class="pre">static</span> </em><code class="sig-name descname"><span class="pre">seekable</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ins</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexOS.seekable" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSAM">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">virtualsmartcard.cards.cryptoflex.</span></code><code class="sig-name descname"><span class="pre">CryptoflexSAM</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">mf</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexSAM" 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 notranslate"><span class="pre">virtualsmartcard.SmartcardSAM.SAM</span></code></a></p>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSAM.FSdecrypt">
<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.cards.cryptoflex.CryptoflexSAM.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="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSAM.FSencrypt">
<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.cards.cryptoflex.CryptoflexSAM.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="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSAM._get_referenced_key">
<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.cards.cryptoflex.CryptoflexSAM._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>
<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 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>
<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>
<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><p>0</p></td>
<td><ul>
<li></li>
</ul>
</td>
<td><ul>
<li></li>
</ul>
</td>
<td><ul>
<li></li>
</ul>
</td>
<td><ul>
<li></li>
</ul>
</td>
<td><ul>
<li></li>
</ul>
</td>
<td><ul>
<li></li>
</ul>
</td>
<td><ul>
<li></li>
</ul>
</td>
<td><p>Global reference data(e.g. MF specific key)</p></td>
</tr>
<tr class="row-even"><td><p>1</p></td>
<td><ul>
<li></li>
</ul>
</td>
<td><ul>
<li></li>
</ul>
</td>
<td><ul>
<li></li>
</ul>
</td>
<td><ul>
<li></li>
</ul>
</td>
<td><ul>
<li></li>
</ul>
</td>
<td><ul>
<li></li>
</ul>
</td>
<td><ul>
<li></li>
</ul>
</td>
<td><p>Specific reference data(e.g. DF specific
key)</p></td>
</tr>
<tr class="row-odd"><td><ul>
<li></li>
</ul>
</td>
<td><ul>
<li></li>
</ul>
</td>
<td><ul>
<li></li>
</ul>
</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>
</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSAM.change_reference_data">
<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.cards.cryptoflex.CryptoflexSAM.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="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSAM.erase_SE">
<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.cards.cryptoflex.CryptoflexSAM.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="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSAM.external_authenticate">
<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.cards.cryptoflex.CryptoflexSAM.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="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSAM.generate_public_key_pair">
<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.cards.cryptoflex.CryptoflexSAM.generate_public_key_pair" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSAM.get_card_number">
<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.cards.cryptoflex.CryptoflexSAM.get_card_number" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSAM.get_challenge">
<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.cards.cryptoflex.CryptoflexSAM.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="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSAM.internal_authenticate">
<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.cards.cryptoflex.CryptoflexSAM.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="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSAM.manage_security_environment">
<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.cards.cryptoflex.CryptoflexSAM.manage_security_environment" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSAM.mutual_authenticate">
<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.cards.cryptoflex.CryptoflexSAM.mutual_authenticate" title="Permalink to this definition"></a></dt>
<dd><p>Takes an encrypted challenge in the form
Terminal Challenge | Card Challenge | Card number
and checks it for validity. If the challenge is successful
the card encrypts Card Challenge | Terminal challenge and
returns this value</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSAM.parse_SM_CAPDU">
<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.cards.cryptoflex.CryptoflexSAM.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="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSAM.perform_security_operation">
<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.cards.cryptoflex.CryptoflexSAM.perform_security_operation" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSAM.pezorform_security_operation">
<code class="sig-name descname"><span class="pre">pezorform_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.cards.cryptoflex.CryptoflexSAM.pezorform_security_operation" title="Permalink to this definition"></a></dt>
<dd><p>In the cryptoflex card, this is the verify key command. A key is send
to the card in plain text and compared to a key stored in the card.
This is used for authentication</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>data</strong> Contains the key to be verified</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>SW[NORMAL] in case of success otherwise SW[WARN_NOINFO63]</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSAM.protect_result">
<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.cards.cryptoflex.CryptoflexSAM.protect_result" title="Permalink to this definition"></a></dt>
<dd><p>Protect a plain response APDU by Secure Messaging</p>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSAM.restore_SE">
<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.cards.cryptoflex.CryptoflexSAM.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="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSAM.set_MF">
<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.cards.cryptoflex.CryptoflexSAM.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="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSAM.set_asym_algorithm">
<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.cards.cryptoflex.CryptoflexSAM.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>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSAM.store_SE">
<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.cards.cryptoflex.CryptoflexSAM.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="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSAM.verify">
<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.cards.cryptoflex.CryptoflexSAM.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="py class">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSE">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">virtualsmartcard.cards.cryptoflex.</span></code><code class="sig-name descname"><span class="pre">CryptoflexSE</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">MF</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">SAM</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexSE" 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 notranslate"><span class="pre">virtualsmartcard.SEutils.Security_Environment</span></code></a></p>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSE._set_SE">
<code class="sig-name descname"><span class="pre">_set_SE</span></code><span class="sig-paren">(</span><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.cards.cryptoflex.CryptoflexSE._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="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSE.compute_cryptographic_checksum">
<code class="sig-name descname"><span class="pre">compute_cryptographic_checksum</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.cards.cryptoflex.CryptoflexSE.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="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSE.compute_digital_signature">
<code class="sig-name descname"><span class="pre">compute_digital_signature</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.cards.cryptoflex.CryptoflexSE.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>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>p1</strong> Must be 0x9E = Secure Messaging class for digital signatures</p></li>
<li><p><strong>p2</strong> Must be one of 0x9A, 0xAC, 0xBC. Indicates what kind of data
is included in the data field.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSE.decipher">
<code class="sig-name descname"><span class="pre">decipher</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.cards.cryptoflex.CryptoflexSE.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>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>raw data (no TLV coding). Padding is not removed!!!</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSE.encipher">
<code class="sig-name descname"><span class="pre">encipher</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.cards.cryptoflex.CryptoflexSE.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>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>raw data (no TLV coding).</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSE.generate_public_key_pair">
<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.cards.cryptoflex.CryptoflexSE.generate_public_key_pair" title="Permalink to this definition"></a></dt>
<dd><p>In the Cryptoflex card this command only supports RSA keys.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>data</strong> Contains the public exponent used for key generation</p></li>
<li><p><strong>p1</strong> The key number. Can be used later to refer to the generated key</p></li>
<li><p><strong>p2</strong> Used to specify the key length. The mapping is: 0x40 =&gt; 256 Bit,
0x60 =&gt; 512 Bit, 0x80 =&gt; 1024</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSE.hash">
<code class="sig-name descname"><span class="pre">hash</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.cards.cryptoflex.CryptoflexSE.hash" title="Permalink to this definition"></a></dt>
<dd><p>Hash the given data using the algorithm specified by the current
Security environment.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>raw data (no TLV coding).</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSE.manage_security_environment">
<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.cards.cryptoflex.CryptoflexSE.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>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>p1</strong> <p>Bitmask according to this table</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 4%" />
<col style="width: 4%" />
<col style="width: 4%" />
<col style="width: 4%" />
<col style="width: 4%" />
<col style="width: 4%" />
<col style="width: 4%" />
<col style="width: 4%" />
<col style="width: 71%" />
</colgroup>
<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>
<tr class="row-even"><td><ul class="simple">
<li></li>
</ul>
</td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><p>1</p></td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><p>Secure messaging in command data field</p></td>
</tr>
<tr class="row-odd"><td><ul class="simple">
<li></li>
</ul>
</td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><p>1</p></td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><p>Secure messaging in response data field</p></td>
</tr>
<tr class="row-even"><td><ul class="simple">
<li></li>
</ul>
</td>
<td><p>1</p></td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><p>Computation, decipherment, internal
authentication and key agreement</p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><p>Verification, encipherment, external
authentication and key agreement</p></td>
</tr>
<tr class="row-even"><td><ul class="simple">
<li></li>
</ul>
</td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><p>0</p></td>
<td><p>0</p></td>
<td><p>0</p></td>
<td><p>1</p></td>
<td><p>SET</p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p>0</p></td>
<td><p>0</p></td>
<td><p>1</p></td>
<td><p>0</p></td>
<td><p>STORE</p></td>
</tr>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p>0</p></td>
<td><p>0</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p>RESTORE</p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p>0</p></td>
<td><p>1</p></td>
<td><p>0</p></td>
<td><p>0</p></td>
<td><p>ERASE</p></td>
</tr>
</tbody>
</table>
</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSE.parse_SM_CAPDU">
<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">authenticate_header</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexSE.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>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>CAPDU</strong> The protected CAPDU to be parsed</p></li>
<li><p><strong>authenticate_header</strong> Whether or not the header should be
included in authentication mechanisms</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Unprotected command APDU</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSE.perform_security_operation">
<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.cards.cryptoflex.CryptoflexSE.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="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSE.protect_response">
<code class="sig-name descname"><span class="pre">protect_response</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">result</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#virtualsmartcard.cards.cryptoflex.CryptoflexSE.protect_response" title="Permalink to this definition"></a></dt>
<dd><p>This method protects a response APDU using secure messaging mechanisms</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the protected data and the SW bytes</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSE.verify_certificate">
<code class="sig-name descname"><span class="pre">verify_certificate</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.cards.cryptoflex.CryptoflexSE.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="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSE.verify_cryptographic_checksum">
<code class="sig-name descname"><span class="pre">verify_cryptographic_checksum</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.cards.cryptoflex.CryptoflexSE.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="py method">
<dt id="virtualsmartcard.cards.cryptoflex.CryptoflexSE.verify_digital_signature">
<code class="sig-name descname"><span class="pre">verify_digital_signature</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.cards.cryptoflex.CryptoflexSE.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-2021 by Dominik Oepen and Frank Morgner.<br/>
</p>
</div>
</footer>
</body>
</html>