1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640
|
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SEutils Module — vsmartcard 2017-01-16 documentation</title>
<link rel="stylesheet" href="../../_static/basic.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/bootswatch-3.3.4/flatly/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="../../_static/bootstrap-sphinx.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../',
VERSION: '2017-01-16',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<script type="text/javascript" src="../../_static/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="../../_static/js/jquery-fix.js"></script>
<script type="text/javascript" src="../../_static/bootstrap-3.3.4/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../../_static/bootstrap-sphinx.js"></script>
<link rel="shortcut icon" href="../../_static/chip.ico"/>
<link rel="top" title="vsmartcard 2017-01-16 documentation" href="../../index.html" />
<link rel="up" title="virtualsmartcard Package" href="virtualsmartcard.html" />
<link rel="next" title="SWutils Module" href="virtualsmartcard.SWutils.html" />
<link rel="prev" title="CryptoUtils Module" href="virtualsmartcard.CryptoUtils.html" />
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">
</head>
<body>
<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 class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../api.html">Creating a Virtual Smart Card</a></li>
</ul>
</ul>
</li>
<li class="dropdown">
<a role="button"
id="dLabelLocalToc"
data-toggle="dropdown"
data-target="#"
href="#">Page <b class="caret"></b></a>
<ul class="dropdown-menu localtoc"
role="menu"
aria-labelledby="dLabelLocalToc"><ul>
<li><a class="reference internal" href="#">SEutils Module</a></li>
</ul>
</ul>
</li>
<li>
<a href="virtualsmartcard.CryptoUtils.html" title="Previous Chapter: CryptoUtils Module"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">« CryptoUtils Modu...</span>
</a>
</li>
<li>
<a href="virtualsmartcard.SWutils.html" title="Next Chapter: SWutils Module"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">SWutils Module »</span>
</a>
</li>
<li class="hidden-sm"></li>
</ul>
<form class="navbar-form navbar-right" action="../../search.html" method="get">
<div class="form-group">
<input type="text" name="q" class="form-control" placeholder="Search" />
</div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-12 content">
<div class="section" id="seutils-module">
<h1>SEutils Module<a class="headerlink" href="#seutils-module" title="Permalink to this headline">¶</a></h1>
<p class="graphviz">
<img src="../../_images/inheritance-9f3c7bc88811fee87e07a30133f7586cb9c7a2ee.png" alt="Inheritance diagram of virtualsmartcard.SEutils" usemap="#inheritance7064aeb8f6" class="inheritance"/>
<map id="inheritance7064aeb8f6" name="inheritance7064aeb8f6">
<area shape="rect" id="node1" href="#virtualsmartcard.SEutils.ControlReferenceTemplate" title="Control Reference Templates are used to configure the Security" alt="" coords="5,55,353,80"/>
<area shape="rect" id="node2" href="#virtualsmartcard.SEutils.Security_Environment" title="virtualsmartcard.SEutils.Security_Environment" alt="" coords="20,5,339,31"/>
</map>
</p>
<span class="target" id="module-virtualsmartcard.SEutils"></span><dl class="class">
<dt id="virtualsmartcard.SEutils.ControlReferenceTemplate">
<em class="property">class </em><tt class="descclassname">virtualsmartcard.SEutils.</tt><tt class="descname">ControlReferenceTemplate</tt><big>(</big><em>tag</em>, <em>config=''</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SEutils.ControlReferenceTemplate" title="Permalink to this definition">¶</a></dt>
<dd><p>Control Reference Templates are used to configure the Security
Environments. They specify which algorithms to use in which mode of
operation and with which keys. There are six different types of Control
Reference Template:
HT, AT, KT, CCT, DST, CT-sym, CT-asym.</p>
<dl class="method">
<dt id="virtualsmartcard.SEutils.ControlReferenceTemplate._ControlReferenceTemplate__replace_tag">
<tt class="descname">_ControlReferenceTemplate__replace_tag</tt><big>(</big><em>tag</em>, <em>data</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SEutils.ControlReferenceTemplate._ControlReferenceTemplate__replace_tag" title="Permalink to this definition">¶</a></dt>
<dd><p>Adjust the config string using a given tag, value combination. If the
config string already contains a tag, value pair for the given tag,
replace it. Otherwise append tag, length and value to the config
string.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.ControlReferenceTemplate._ControlReferenceTemplate__set_algo">
<tt class="descname">_ControlReferenceTemplate__set_algo</tt><big>(</big><em>data</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SEutils.ControlReferenceTemplate._ControlReferenceTemplate__set_algo" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the algorithm to be used by this CRT. The algorithms are specified
in a global dictionary. New cards may add or modify this table in order
to support new or different algorithms.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>data</strong> – reference to an algorithm</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.ControlReferenceTemplate._ControlReferenceTemplate__set_iv">
<tt class="descname">_ControlReferenceTemplate__set_iv</tt><big>(</big><em>tag</em>, <em>length</em>, <em>value</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SEutils.ControlReferenceTemplate._ControlReferenceTemplate__set_iv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.ControlReferenceTemplate._ControlReferenceTemplate__set_key">
<tt class="descname">_ControlReferenceTemplate__set_key</tt><big>(</big><em>tag</em>, <em>value</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SEutils.ControlReferenceTemplate._ControlReferenceTemplate__set_key" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.ControlReferenceTemplate.parse_SE_config">
<tt class="descname">parse_SE_config</tt><big>(</big><em>config</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SEutils.ControlReferenceTemplate.parse_SE_config" title="Permalink to this definition">¶</a></dt>
<dd><p>Parse a control reference template as given e.g. in an MSE APDU.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>config</strong> – a TLV string containing the configuration for the CRT.</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.ControlReferenceTemplate.to_string">
<tt class="descname">to_string</tt><big>(</big><big>)</big><a class="headerlink" href="#virtualsmartcard.SEutils.ControlReferenceTemplate.to_string" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the content of the CRT, encoded as TLV data in a string</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="virtualsmartcard.SEutils.Security_Environment">
<em class="property">class </em><tt class="descclassname">virtualsmartcard.SEutils.</tt><tt class="descname">Security_Environment</tt><big>(</big><em>MF</em>, <em>SAM</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment._set_SE">
<tt class="descname">_set_SE</tt><big>(</big><em>p2</em>, <em>data</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment._set_SE" title="Permalink to this definition">¶</a></dt>
<dd><p>Manipulate the current Security Environment. P2 is the tag of a
control reference template, data contains control reference objects</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.compute_cryptographic_checksum">
<tt class="descname">compute_cryptographic_checksum</tt><big>(</big><em>p1</em>, <em>p2</em>, <em>data</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.compute_cryptographic_checksum" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute a cryptographic checksum (e.g. MAC) for the given data.
Algorithm and key are specified in the current SE</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.compute_digital_signature">
<tt class="descname">compute_digital_signature</tt><big>(</big><em>p1</em>, <em>p2</em>, <em>data</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.compute_digital_signature" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute a digital signature for the given data.
Algorithm and key are specified in the current SE</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>p1</strong> – Must be 0x9E = Secure Messaging class for digital signatures</li>
<li><strong>p2</strong> – Must be one of 0x9A, 0xAC, 0xBC. Indicates what kind of data
is included in the data field.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.decipher">
<tt class="descname">decipher</tt><big>(</big><em>p1</em>, <em>p2</em>, <em>data</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.decipher" title="Permalink to this definition">¶</a></dt>
<dd><p>Decipher data using key, algorithm, IV and Padding specified
by the current Security environment.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">raw data (no TLV coding). Padding is not removed!!!</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.encipher">
<tt class="descname">encipher</tt><big>(</big><em>p1</em>, <em>p2</em>, <em>data</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.encipher" title="Permalink to this definition">¶</a></dt>
<dd><p>Encipher data using key, algorithm, IV and Padding specified
by the current Security environment.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">raw data (no TLV coding).</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.generate_public_key_pair">
<tt class="descname">generate_public_key_pair</tt><big>(</big><em>p1</em>, <em>p2</em>, <em>data</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.generate_public_key_pair" title="Permalink to this definition">¶</a></dt>
<dd><p>The GENERATE PUBLIC-KEY PAIR command either initiates the generation
and storing of a key pair, i.e., a public key and a private key, in the
card, or accesses a key pair previously generated in the card.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>p1</strong> – should be 0x00 (generate new key)</li>
<li><strong>p2</strong> – ‘00’ (no information provided) or reference of the key to
be generated</li>
<li><strong>data</strong> – One or more CRTs associated to the key generation if
P1-P2 different from ‘0000’</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.hash">
<tt class="descname">hash</tt><big>(</big><em>p1</em>, <em>p2</em>, <em>data</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.hash" title="Permalink to this definition">¶</a></dt>
<dd><p>Hash the given data using the algorithm specified by the current
Security environment.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">raw data (no TLV coding).</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.manage_security_environment">
<tt class="descname">manage_security_environment</tt><big>(</big><em>p1</em>, <em>p2</em>, <em>data</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.manage_security_environment" title="Permalink to this definition">¶</a></dt>
<dd><p>This method is used to store, restore or erase Security Environments
or to manipulate the various parameters of the current SE.
P1 specifies the operation to perform, p2 is either the SEID for the
referred SE or the tag of a control reference template</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>p1</strong> – <p>Bitmask according to this table</p>
<table border="1" class="docutils">
<colgroup>
<col width="4%" />
<col width="4%" />
<col width="4%" />
<col width="4%" />
<col width="4%" />
<col width="4%" />
<col width="4%" />
<col width="4%" />
<col width="71%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">b8</th>
<th class="head">b7</th>
<th class="head">b6</th>
<th class="head">b5</th>
<th class="head">b4</th>
<th class="head">b3</th>
<th class="head">b2</th>
<th class="head">b1</th>
<th class="head">Meaning</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td>1</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td>Secure messaging in command data field</td>
</tr>
<tr class="row-odd"><td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td>1</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td>Secure messaging in response data field</td>
</tr>
<tr class="row-even"><td><ul class="first last simple">
<li></li>
</ul>
</td>
<td>1</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td>Computation, decipherment, internal
authentication and key agreement</td>
</tr>
<tr class="row-odd"><td>1</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td>Verification, encipherment, external
authentication and key agreement</td>
</tr>
<tr class="row-even"><td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td><ul class="first last simple">
<li></li>
</ul>
</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>SET</td>
</tr>
<tr class="row-odd"><td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>STORE</td>
</tr>
<tr class="row-even"><td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>RESTORE</td>
</tr>
<tr class="row-odd"><td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>ERASE</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.parse_SM_CAPDU">
<tt class="descname">parse_SM_CAPDU</tt><big>(</big><em>CAPDU</em>, <em>authenticate_header</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.parse_SM_CAPDU" title="Permalink to this definition">¶</a></dt>
<dd><p>This methods parses a data field including Secure Messaging objects.
SM_header indicates whether or not the header of the message shall be
authenticated. It returns an unprotected command APDU</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>CAPDU</strong> – The protected CAPDU to be parsed</li>
<li><strong>authenticate_header</strong> – Whether or not the header should be
included in authentication mechanisms</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Unprotected command APDU</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.perform_security_operation">
<tt class="descname">perform_security_operation</tt><big>(</big><em>p1</em>, <em>p2</em>, <em>data</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.perform_security_operation" title="Permalink to this definition">¶</a></dt>
<dd><p>In the end this command is nothing but a big switch for all the other
commands in ISO 7816-8. It will invoke the appropriate command and
return its result</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.protect_response">
<tt class="descname">protect_response</tt><big>(</big><em>sw</em>, <em>result</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.protect_response" title="Permalink to this definition">¶</a></dt>
<dd><p>This method protects a response APDU using secure messaging mechanisms</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">the protected data and the SW bytes</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.verify_certificate">
<tt class="descname">verify_certificate</tt><big>(</big><em>p1</em>, <em>p2</em>, <em>data</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.verify_certificate" title="Permalink to this definition">¶</a></dt>
<dd><p>Verify a certificate send by the terminal using the internal trust
anchors.
This method is currently not implemented.</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.verify_cryptographic_checksum">
<tt class="descname">verify_cryptographic_checksum</tt><big>(</big><em>p1</em>, <em>p2</em>, <em>data</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.verify_cryptographic_checksum" title="Permalink to this definition">¶</a></dt>
<dd><p>Verify the cryptographic checksum contained in the data field.
Data field must contain a cryptographic checksum (tag 0x8E) and a plain
value (tag 0x80)</p>
</dd></dl>
<dl class="method">
<dt id="virtualsmartcard.SEutils.Security_Environment.verify_digital_signature">
<tt class="descname">verify_digital_signature</tt><big>(</big><em>p1</em>, <em>p2</em>, <em>data</em><big>)</big><a class="headerlink" href="#virtualsmartcard.SEutils.Security_Environment.verify_digital_signature" title="Permalink to this definition">¶</a></dt>
<dd><p>Verify the digital signature contained in the data field. Data must
contain a data to sign (tag 0x9A, 0xAC or 0xBC) and a digital signature
(0x9E)</p>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
© Copyright 2009-2017 by Dominik Oepen and Frank Morgner.<br/>
</p>
</div>
</footer>
</body>
</html>
|