/usr/share/doc/python-openssl-doc/html/api/crypto.html is in python-openssl-doc 0.15.1-2ubuntu0.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>crypto — Generic cryptographic module — pyOpenSSL 0.15.1 documentation</title>
<link rel="stylesheet" href="../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.15.1',
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>
<link rel="top" title="pyOpenSSL 0.15.1 documentation" href="../index.html" />
<link rel="up" title="OpenSSL — Python interface to OpenSSL" href="../api.html" />
<link rel="next" title="rand — An interface to the OpenSSL pseudo random number generator" href="rand.html" />
<link rel="prev" title="OpenSSL — Python interface to OpenSSL" href="../api.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="rand.html" title="rand — An interface to the OpenSSL pseudo random number generator"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="../api.html" title="OpenSSL — Python interface to OpenSSL"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">pyOpenSSL 0.15.1 documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="../api.html" accesskey="U"><code class="docutils literal"><span class="pre">OpenSSL</span></code> — Python interface to OpenSSL</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="module-OpenSSL.crypto">
<span id="crypto-generic-cryptographic-module"></span><span id="openssl-crypto"></span><h1><code class="xref py py-mod docutils literal"><span class="pre">crypto</span></code> — Generic cryptographic module<a class="headerlink" href="#module-OpenSSL.crypto" title="Permalink to this headline">¶</a></h1>
<dl class="data">
<dt id="OpenSSL.crypto.X509Type">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">X509Type</code><a class="headerlink" href="#OpenSSL.crypto.X509Type" title="Permalink to this definition">¶</a></dt>
<dd><p>See <a class="reference internal" href="#OpenSSL.crypto.X509" title="OpenSSL.crypto.X509"><code class="xref py py-class docutils literal"><span class="pre">X509</span></code></a>.</p>
</dd></dl>
<dl class="class">
<dt id="OpenSSL.crypto.X509">
<em class="property">class </em><code class="descclassname">OpenSSL.crypto.</code><code class="descname">X509</code><a class="headerlink" href="#OpenSSL.crypto.X509" title="Permalink to this definition">¶</a></dt>
<dd><p>A class representing X.509 certificates.</p>
</dd></dl>
<dl class="data">
<dt id="OpenSSL.crypto.X509NameType">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">X509NameType</code><a class="headerlink" href="#OpenSSL.crypto.X509NameType" title="Permalink to this definition">¶</a></dt>
<dd><p>See <a class="reference internal" href="#OpenSSL.crypto.X509Name" title="OpenSSL.crypto.X509Name"><code class="xref py py-class docutils literal"><span class="pre">X509Name</span></code></a>.</p>
</dd></dl>
<dl class="class">
<dt id="OpenSSL.crypto.X509Name">
<em class="property">class </em><code class="descclassname">OpenSSL.crypto.</code><code class="descname">X509Name</code><span class="sig-paren">(</span><em>x509name</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509Name" title="Permalink to this definition">¶</a></dt>
<dd><p>A class representing X.509 Distinguished Names.</p>
<p>This constructor creates a copy of <em>x509name</em> which should be an
instance of <a class="reference internal" href="#OpenSSL.crypto.X509Name" title="OpenSSL.crypto.X509Name"><code class="xref py py-class docutils literal"><span class="pre">X509Name</span></code></a>.</p>
</dd></dl>
<dl class="data">
<dt id="OpenSSL.crypto.X509ReqType">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">X509ReqType</code><a class="headerlink" href="#OpenSSL.crypto.X509ReqType" title="Permalink to this definition">¶</a></dt>
<dd><p>See <a class="reference internal" href="#OpenSSL.crypto.X509Req" title="OpenSSL.crypto.X509Req"><code class="xref py py-class docutils literal"><span class="pre">X509Req</span></code></a>.</p>
</dd></dl>
<dl class="class">
<dt id="OpenSSL.crypto.X509Req">
<em class="property">class </em><code class="descclassname">OpenSSL.crypto.</code><code class="descname">X509Req</code><a class="headerlink" href="#OpenSSL.crypto.X509Req" title="Permalink to this definition">¶</a></dt>
<dd><p>A class representing X.509 certificate requests.</p>
</dd></dl>
<dl class="data">
<dt id="OpenSSL.crypto.X509StoreType">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">X509StoreType</code><a class="headerlink" href="#OpenSSL.crypto.X509StoreType" title="Permalink to this definition">¶</a></dt>
<dd><p>See <code class="xref py py-class docutils literal"><span class="pre">X509Store</span></code></p>
</dd></dl>
<dl class="data">
<dt id="OpenSSL.crypto.X509StoreContext">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">X509StoreContext</code><a class="headerlink" href="#OpenSSL.crypto.X509StoreContext" title="Permalink to this definition">¶</a></dt>
<dd><p>A class representing the X.509 store context.</p>
</dd></dl>
<dl class="data">
<dt id="OpenSSL.crypto.PKeyType">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">PKeyType</code><a class="headerlink" href="#OpenSSL.crypto.PKeyType" title="Permalink to this definition">¶</a></dt>
<dd><p>See <a class="reference internal" href="#OpenSSL.crypto.PKey" title="OpenSSL.crypto.PKey"><code class="xref py py-class docutils literal"><span class="pre">PKey</span></code></a>.</p>
</dd></dl>
<dl class="class">
<dt id="OpenSSL.crypto.PKey">
<em class="property">class </em><code class="descclassname">OpenSSL.crypto.</code><code class="descname">PKey</code><a class="headerlink" href="#OpenSSL.crypto.PKey" title="Permalink to this definition">¶</a></dt>
<dd><p>A class representing DSA or RSA keys.</p>
</dd></dl>
<dl class="data">
<dt id="OpenSSL.crypto.PKCS7Type">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">PKCS7Type</code><a class="headerlink" href="#OpenSSL.crypto.PKCS7Type" title="Permalink to this definition">¶</a></dt>
<dd><p>A Python type object representing the PKCS7 object type.</p>
</dd></dl>
<dl class="data">
<dt id="OpenSSL.crypto.PKCS12Type">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">PKCS12Type</code><a class="headerlink" href="#OpenSSL.crypto.PKCS12Type" title="Permalink to this definition">¶</a></dt>
<dd><p>A Python type object representing the PKCS12 object type.</p>
</dd></dl>
<dl class="data">
<dt id="OpenSSL.crypto.X509ExtensionType">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">X509ExtensionType</code><a class="headerlink" href="#OpenSSL.crypto.X509ExtensionType" title="Permalink to this definition">¶</a></dt>
<dd><p>See <a class="reference internal" href="#OpenSSL.crypto.X509Extension" title="OpenSSL.crypto.X509Extension"><code class="xref py py-class docutils literal"><span class="pre">X509Extension</span></code></a>.</p>
</dd></dl>
<dl class="class">
<dt id="OpenSSL.crypto.X509Extension">
<em class="property">class </em><code class="descclassname">OpenSSL.crypto.</code><code class="descname">X509Extension</code><span class="sig-paren">(</span><em>typename, critical, value[, subject][, issuer]</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509Extension" title="Permalink to this definition">¶</a></dt>
<dd><p>A class representing an X.509 v3 certificate extensions. See
<a class="reference external" href="http://openssl.org/docs/apps/x509v3_config.html#STANDARD_EXTENSIONS">http://openssl.org/docs/apps/x509v3_config.html#STANDARD_EXTENSIONS</a> for
<em>typename</em> strings and their options. Optional parameters <em>subject</em> and
<em>issuer</em> must be X509 objects.</p>
</dd></dl>
<dl class="data">
<dt id="OpenSSL.crypto.NetscapeSPKIType">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">NetscapeSPKIType</code><a class="headerlink" href="#OpenSSL.crypto.NetscapeSPKIType" title="Permalink to this definition">¶</a></dt>
<dd><p>See <a class="reference internal" href="#OpenSSL.crypto.NetscapeSPKI" title="OpenSSL.crypto.NetscapeSPKI"><code class="xref py py-class docutils literal"><span class="pre">NetscapeSPKI</span></code></a>.</p>
</dd></dl>
<dl class="class">
<dt id="OpenSSL.crypto.NetscapeSPKI">
<em class="property">class </em><code class="descclassname">OpenSSL.crypto.</code><code class="descname">NetscapeSPKI</code><span class="sig-paren">(</span><span class="optional">[</span><em>enc</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.NetscapeSPKI" title="Permalink to this definition">¶</a></dt>
<dd><p>A class representing Netscape SPKI objects.</p>
<p>If the <em>enc</em> argument is present, it should be a base64-encoded string
representing a NetscapeSPKI object, as returned by the <a class="reference internal" href="#OpenSSL.crypto.NetscapeSPKI.b64_encode" title="OpenSSL.crypto.NetscapeSPKI.b64_encode"><code class="xref py py-meth docutils literal"><span class="pre">b64_encode()</span></code></a>
method.</p>
</dd></dl>
<dl class="class">
<dt id="OpenSSL.crypto.CRL">
<em class="property">class </em><code class="descclassname">OpenSSL.crypto.</code><code class="descname">CRL</code><a class="headerlink" href="#OpenSSL.crypto.CRL" title="Permalink to this definition">¶</a></dt>
<dd><p>A class representing Certifcate Revocation List objects.</p>
</dd></dl>
<dl class="class">
<dt id="OpenSSL.crypto.Revoked">
<em class="property">class </em><code class="descclassname">OpenSSL.crypto.</code><code class="descname">Revoked</code><a class="headerlink" href="#OpenSSL.crypto.Revoked" title="Permalink to this definition">¶</a></dt>
<dd><p>A class representing Revocation objects of CRL.</p>
</dd></dl>
<dl class="data">
<dt id="OpenSSL.crypto.FILETYPE_PEM">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">FILETYPE_PEM</code><a class="headerlink" href="#OpenSSL.crypto.FILETYPE_PEM" title="Permalink to this definition">¶</a></dt>
<dt id="OpenSSL.crypto.FILETYPE_ASN1">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">FILETYPE_ASN1</code><a class="headerlink" href="#OpenSSL.crypto.FILETYPE_ASN1" title="Permalink to this definition">¶</a></dt>
<dd><p>File type constants.</p>
</dd></dl>
<dl class="data">
<dt id="OpenSSL.crypto.TYPE_RSA">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">TYPE_RSA</code><a class="headerlink" href="#OpenSSL.crypto.TYPE_RSA" title="Permalink to this definition">¶</a></dt>
<dt id="OpenSSL.crypto.TYPE_DSA">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">TYPE_DSA</code><a class="headerlink" href="#OpenSSL.crypto.TYPE_DSA" title="Permalink to this definition">¶</a></dt>
<dd><p>Key type constants.</p>
</dd></dl>
<dl class="exception">
<dt id="OpenSSL.crypto.Error">
<em class="property">exception </em><code class="descclassname">OpenSSL.crypto.</code><code class="descname">Error</code><a class="headerlink" href="#OpenSSL.crypto.Error" title="Permalink to this definition">¶</a></dt>
<dd><p>Generic exception used in the <a class="reference internal" href="#module-OpenSSL.crypto" title="OpenSSL.crypto: Generic cryptographic module"><code class="xref py py-mod docutils literal"><span class="pre">crypto</span></code></a> module.</p>
</dd></dl>
<dl class="function">
<dt id="OpenSSL.crypto.get_elliptic_curves">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">get_elliptic_curves</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.get_elliptic_curves" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a set of objects representing the elliptic curves supported in the
OpenSSL build in use.</p>
<p>The curve objects have a <code class="xref py py-class docutils literal"><span class="pre">unicode</span></code> <code class="docutils literal"><span class="pre">name</span></code> attribute by which
they identify themselves.</p>
<p>The curve objects are useful as values for the argument accepted by
<code class="xref py py-meth docutils literal"><span class="pre">Context.set_tmp_ecdh()</span></code> to specify which elliptical curve should be
used for ECDHE key exchange.</p>
</dd></dl>
<dl class="function">
<dt id="OpenSSL.crypto.get_elliptic_curve">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">get_elliptic_curve</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.get_elliptic_curve" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a single curve object selected by name.</p>
<p>See <a class="reference internal" href="#OpenSSL.crypto.get_elliptic_curves" title="OpenSSL.crypto.get_elliptic_curves"><code class="xref py py-func docutils literal"><span class="pre">get_elliptic_curves()</span></code></a> for information about curve objects.</p>
<p>If the named curve is not supported then <code class="xref py py-class docutils literal"><span class="pre">ValueError</span></code> is raised.</p>
</dd></dl>
<dl class="function">
<dt id="OpenSSL.crypto.dump_certificate">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">dump_certificate</code><span class="sig-paren">(</span><em>type</em>, <em>cert</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.dump_certificate" title="Permalink to this definition">¶</a></dt>
<dd><p>Dump the certificate <em>cert</em> into a buffer string encoded with the type
<em>type</em>.</p>
</dd></dl>
<dl class="function">
<dt id="OpenSSL.crypto.dump_certificate_request">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">dump_certificate_request</code><span class="sig-paren">(</span><em>type</em>, <em>req</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.dump_certificate_request" title="Permalink to this definition">¶</a></dt>
<dd><p>Dump the certificate request <em>req</em> into a buffer string encoded with the
type <em>type</em>.</p>
</dd></dl>
<dl class="function">
<dt id="OpenSSL.crypto.dump_privatekey">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">dump_privatekey</code><span class="sig-paren">(</span><em>type</em>, <em>pkey</em><span class="optional">[</span>, <em>cipher</em>, <em>passphrase</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.dump_privatekey" title="Permalink to this definition">¶</a></dt>
<dd><p>Dump the private key <em>pkey</em> into a buffer string encoded with the type
<em>type</em>, optionally (if <em>type</em> is <a class="reference internal" href="#OpenSSL.crypto.FILETYPE_PEM" title="OpenSSL.crypto.FILETYPE_PEM"><code class="xref py py-const docutils literal"><span class="pre">FILETYPE_PEM</span></code></a>) encrypting it
using <em>cipher</em> and <em>passphrase</em>.</p>
<p><em>passphrase</em> must be either a string or a callback for providing the
pass phrase.</p>
</dd></dl>
<dl class="function">
<dt id="OpenSSL.crypto.load_certificate">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">load_certificate</code><span class="sig-paren">(</span><em>type</em>, <em>buffer</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.load_certificate" title="Permalink to this definition">¶</a></dt>
<dd><p>Load a certificate (X509) from the string <em>buffer</em> encoded with the
type <em>type</em>.</p>
</dd></dl>
<dl class="function">
<dt id="OpenSSL.crypto.load_certificate_request">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">load_certificate_request</code><span class="sig-paren">(</span><em>type</em>, <em>buffer</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.load_certificate_request" title="Permalink to this definition">¶</a></dt>
<dd><p>Load a certificate request (X509Req) from the string <em>buffer</em> encoded with
the type <em>type</em>.</p>
</dd></dl>
<dl class="function">
<dt id="OpenSSL.crypto.load_privatekey">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">load_privatekey</code><span class="sig-paren">(</span><em>type</em>, <em>buffer</em><span class="optional">[</span>, <em>passphrase</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.load_privatekey" title="Permalink to this definition">¶</a></dt>
<dd><p>Load a private key (PKey) from the string <em>buffer</em> encoded with the type
<em>type</em> (must be one of <a class="reference internal" href="#OpenSSL.crypto.FILETYPE_PEM" title="OpenSSL.crypto.FILETYPE_PEM"><code class="xref py py-const docutils literal"><span class="pre">FILETYPE_PEM</span></code></a> and
<a class="reference internal" href="#OpenSSL.crypto.FILETYPE_ASN1" title="OpenSSL.crypto.FILETYPE_ASN1"><code class="xref py py-const docutils literal"><span class="pre">FILETYPE_ASN1</span></code></a>).</p>
<p><em>passphrase</em> must be either a string or a callback for providing the pass
phrase.</p>
</dd></dl>
<dl class="function">
<dt id="OpenSSL.crypto.load_crl">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">load_crl</code><span class="sig-paren">(</span><em>type</em>, <em>buffer</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.load_crl" title="Permalink to this definition">¶</a></dt>
<dd><p>Load Certificate Revocation List (CRL) data from a string <em>buffer</em>.
<em>buffer</em> encoded with the type <em>type</em>. The type <em>type</em> must either
<a class="reference internal" href="#OpenSSL.crypto.FILETYPE_PEM" title="OpenSSL.crypto.FILETYPE_PEM"><code class="xref py py-const docutils literal"><span class="pre">FILETYPE_PEM</span></code></a> or <a class="reference internal" href="#OpenSSL.crypto.FILETYPE_ASN1" title="OpenSSL.crypto.FILETYPE_ASN1"><code class="xref py py-const docutils literal"><span class="pre">FILETYPE_ASN1</span></code></a>).</p>
</dd></dl>
<dl class="function">
<dt id="OpenSSL.crypto.load_pkcs7_data">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">load_pkcs7_data</code><span class="sig-paren">(</span><em>type</em>, <em>buffer</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.load_pkcs7_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Load pkcs7 data from the string <em>buffer</em> encoded with the type <em>type</em>.</p>
</dd></dl>
<dl class="function">
<dt id="OpenSSL.crypto.load_pkcs12">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">load_pkcs12</code><span class="sig-paren">(</span><em>buffer</em><span class="optional">[</span>, <em>passphrase</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.load_pkcs12" title="Permalink to this definition">¶</a></dt>
<dd><p>Load pkcs12 data from the string <em>buffer</em>. If the pkcs12 structure is
encrypted, a <em>passphrase</em> must be included. The MAC is always
checked and thus required.</p>
<p>See also the man page for the C function <code class="xref py py-func docutils literal"><span class="pre">PKCS12_parse()</span></code>.</p>
</dd></dl>
<dl class="function">
<dt id="OpenSSL.crypto.sign">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">sign</code><span class="sig-paren">(</span><em>key</em>, <em>data</em>, <em>digest</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.sign" title="Permalink to this definition">¶</a></dt>
<dd><p>Sign a data string using the given key and message digest.</p>
<p><em>key</em> is a <a class="reference internal" href="#OpenSSL.crypto.PKey" title="OpenSSL.crypto.PKey"><code class="xref py py-class docutils literal"><span class="pre">PKey</span></code></a> instance. <em>data</em> is a <code class="docutils literal"><span class="pre">str</span></code> instance.
<em>digest</em> is a <code class="docutils literal"><span class="pre">str</span></code> naming a supported message digest type, for example
<code class="xref py py-const docutils literal"><span class="pre">sha1</span></code>.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.11.</span></p>
</div>
</dd></dl>
<dl class="function">
<dt id="OpenSSL.crypto.verify">
<code class="descclassname">OpenSSL.crypto.</code><code class="descname">verify</code><span class="sig-paren">(</span><em>certificate</em>, <em>signature</em>, <em>data</em>, <em>digest</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.verify" title="Permalink to this definition">¶</a></dt>
<dd><p>Verify the signature for a data string.</p>
<p><em>certificate</em> is a <a class="reference internal" href="#OpenSSL.crypto.X509" title="OpenSSL.crypto.X509"><code class="xref py py-class docutils literal"><span class="pre">X509</span></code></a> instance corresponding to the private
key which generated the signature. <em>signature</em> is a <em>str</em> instance giving
the signature itself. <em>data</em> is a <em>str</em> instance giving the data to which
the signature applies. <em>digest</em> is a <em>str</em> instance naming the message
digest type of the signature, for example <code class="xref py py-const docutils literal"><span class="pre">sha1</span></code>.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.11.</span></p>
</div>
</dd></dl>
<div class="section" id="x509-objects">
<span id="openssl-x509"></span><h2>X509 objects<a class="headerlink" href="#x509-objects" title="Permalink to this headline">¶</a></h2>
<p>X509 objects have the following methods:</p>
<dl class="method">
<dt id="OpenSSL.crypto.X509.get_issuer">
<code class="descclassname">X509.</code><code class="descname">get_issuer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509.get_issuer" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an X509Name object representing the issuer of the certificate.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509.get_pubkey">
<code class="descclassname">X509.</code><code class="descname">get_pubkey</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509.get_pubkey" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a <a class="reference internal" href="#OpenSSL.crypto.PKey" title="OpenSSL.crypto.PKey"><code class="xref py py-class docutils literal"><span class="pre">PKey</span></code></a> object representing the public key of the certificate.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509.get_serial_number">
<code class="descclassname">X509.</code><code class="descname">get_serial_number</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509.get_serial_number" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the certificate serial number.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509.get_signature_algorithm">
<code class="descclassname">X509.</code><code class="descname">get_signature_algorithm</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509.get_signature_algorithm" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the signature algorithm used in the certificate. If the algorithm is
undefined, raise <code class="xref py py-data docutils literal"><span class="pre">ValueError</span></code>.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.13.</span></p>
</div>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509.get_subject">
<code class="descclassname">X509.</code><code class="descname">get_subject</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509.get_subject" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an <a class="reference internal" href="#OpenSSL.crypto.X509Name" title="OpenSSL.crypto.X509Name"><code class="xref py py-class docutils literal"><span class="pre">X509Name</span></code></a> object representing the subject of the certificate.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509.get_version">
<code class="descclassname">X509.</code><code class="descname">get_version</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509.get_version" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the certificate version.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509.get_notBefore">
<code class="descclassname">X509.</code><code class="descname">get_notBefore</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509.get_notBefore" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a string giving the time before which the certificate is not valid. The
string is formatted as an ASN1 GENERALIZEDTIME:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">YYYYMMDDhhmmssZ</span>
<span class="n">YYYYMMDDhhmmss</span><span class="o">+</span><span class="n">hhmm</span>
<span class="n">YYYYMMDDhhmmss</span><span class="o">-</span><span class="n">hhmm</span>
</pre></div>
</div>
<p>If no value exists for this field, <code class="xref py py-data docutils literal"><span class="pre">None</span></code> is returned.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509.get_notAfter">
<code class="descclassname">X509.</code><code class="descname">get_notAfter</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509.get_notAfter" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a string giving the time after which the certificate is not valid. The
string is formatted as an ASN1 GENERALIZEDTIME:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">YYYYMMDDhhmmssZ</span>
<span class="n">YYYYMMDDhhmmss</span><span class="o">+</span><span class="n">hhmm</span>
<span class="n">YYYYMMDDhhmmss</span><span class="o">-</span><span class="n">hhmm</span>
</pre></div>
</div>
<p>If no value exists for this field, <code class="xref py py-data docutils literal"><span class="pre">None</span></code> is returned.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509.set_notBefore">
<code class="descclassname">X509.</code><code class="descname">set_notBefore</code><span class="sig-paren">(</span><em>when</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509.set_notBefore" title="Permalink to this definition">¶</a></dt>
<dd><p>Change the time before which the certificate is not valid. <em>when</em> is a
string formatted as an ASN1 GENERALIZEDTIME:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">YYYYMMDDhhmmssZ</span>
<span class="n">YYYYMMDDhhmmss</span><span class="o">+</span><span class="n">hhmm</span>
<span class="n">YYYYMMDDhhmmss</span><span class="o">-</span><span class="n">hhmm</span>
</pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509.set_notAfter">
<code class="descclassname">X509.</code><code class="descname">set_notAfter</code><span class="sig-paren">(</span><em>when</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509.set_notAfter" title="Permalink to this definition">¶</a></dt>
<dd><p>Change the time after which the certificate is not valid. <em>when</em> is a
string formatted as an ASN1 GENERALIZEDTIME:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">YYYYMMDDhhmmssZ</span>
<span class="n">YYYYMMDDhhmmss</span><span class="o">+</span><span class="n">hhmm</span>
<span class="n">YYYYMMDDhhmmss</span><span class="o">-</span><span class="n">hhmm</span>
</pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509.gmtime_adj_notBefore">
<code class="descclassname">X509.</code><code class="descname">gmtime_adj_notBefore</code><span class="sig-paren">(</span><em>time</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509.gmtime_adj_notBefore" title="Permalink to this definition">¶</a></dt>
<dd><p>Adjust the timestamp (in GMT) when the certificate starts being valid.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509.gmtime_adj_notAfter">
<code class="descclassname">X509.</code><code class="descname">gmtime_adj_notAfter</code><span class="sig-paren">(</span><em>time</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509.gmtime_adj_notAfter" title="Permalink to this definition">¶</a></dt>
<dd><p>Adjust the timestamp (in GMT) when the certificate stops being valid.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509.has_expired">
<code class="descclassname">X509.</code><code class="descname">has_expired</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509.has_expired" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks the certificate’s time stamp against current time. Returns true if the
certificate has expired and false otherwise.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509.set_issuer">
<code class="descclassname">X509.</code><code class="descname">set_issuer</code><span class="sig-paren">(</span><em>issuer</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509.set_issuer" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the issuer of the certificate to <em>issuer</em>.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509.set_pubkey">
<code class="descclassname">X509.</code><code class="descname">set_pubkey</code><span class="sig-paren">(</span><em>pkey</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509.set_pubkey" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the public key of the certificate to <em>pkey</em>.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509.set_serial_number">
<code class="descclassname">X509.</code><code class="descname">set_serial_number</code><span class="sig-paren">(</span><em>serialno</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509.set_serial_number" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the serial number of the certificate to <em>serialno</em>.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509.set_subject">
<code class="descclassname">X509.</code><code class="descname">set_subject</code><span class="sig-paren">(</span><em>subject</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509.set_subject" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the subject of the certificate to <em>subject</em>.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509.set_version">
<code class="descclassname">X509.</code><code class="descname">set_version</code><span class="sig-paren">(</span><em>version</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509.set_version" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the certificate version to <em>version</em>.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509.sign">
<code class="descclassname">X509.</code><code class="descname">sign</code><span class="sig-paren">(</span><em>pkey</em>, <em>digest</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509.sign" title="Permalink to this definition">¶</a></dt>
<dd><p>Sign the certificate, using the key <em>pkey</em> and the message digest algorithm
identified by the string <em>digest</em>.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509.subject_name_hash">
<code class="descclassname">X509.</code><code class="descname">subject_name_hash</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509.subject_name_hash" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the hash of the certificate subject.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509.digest">
<code class="descclassname">X509.</code><code class="descname">digest</code><span class="sig-paren">(</span><em>digest_name</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509.digest" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a digest of the certificate, using the <em>digest_name</em> method.
<em>digest_name</em> must be a string describing a digest algorithm supported
by OpenSSL (by EVP_get_digestbyname, specifically). For example,
<code class="xref py py-const docutils literal"><span class="pre">"md5"</span></code> or <code class="xref py py-const docutils literal"><span class="pre">"sha1"</span></code>.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509.add_extensions">
<code class="descclassname">X509.</code><code class="descname">add_extensions</code><span class="sig-paren">(</span><em>extensions</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509.add_extensions" title="Permalink to this definition">¶</a></dt>
<dd><p>Add the extensions in the sequence <em>extensions</em> to the certificate.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509.get_extension_count">
<code class="descclassname">X509.</code><code class="descname">get_extension_count</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509.get_extension_count" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the number of extensions on this certificate.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.12.</span></p>
</div>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509.get_extension">
<code class="descclassname">X509.</code><code class="descname">get_extension</code><span class="sig-paren">(</span><em>index</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509.get_extension" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve the extension on this certificate at the given index.</p>
<p>Extensions on a certificate are kept in order. The index parameter selects
which extension will be returned. The returned object will be an
<a class="reference internal" href="#OpenSSL.crypto.X509Extension" title="OpenSSL.crypto.X509Extension"><code class="xref py py-class docutils literal"><span class="pre">X509Extension</span></code></a> instance.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.12.</span></p>
</div>
</dd></dl>
</div>
<div class="section" id="x509name-objects">
<span id="openssl-x509name"></span><h2>X509Name objects<a class="headerlink" href="#x509name-objects" title="Permalink to this headline">¶</a></h2>
<p>X509Name objects have the following methods:</p>
<dl class="method">
<dt id="OpenSSL.crypto.X509Name.hash">
<code class="descclassname">X509Name.</code><code class="descname">hash</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509Name.hash" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an integer giving the first four bytes of the MD5 digest of the DER
representation of the name.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509Name.der">
<code class="descclassname">X509Name.</code><code class="descname">der</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509Name.der" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a string giving the DER representation of the name.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509Name.get_components">
<code class="descclassname">X509Name.</code><code class="descname">get_components</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509Name.get_components" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a list of two-tuples of strings giving the components of the name.</p>
</dd></dl>
<p>X509Name objects have the following members:</p>
<dl class="attribute">
<dt id="OpenSSL.crypto.X509Name.countryName">
<code class="descclassname">X509Name.</code><code class="descname">countryName</code><a class="headerlink" href="#OpenSSL.crypto.X509Name.countryName" title="Permalink to this definition">¶</a></dt>
<dd><p>The country of the entity. <code class="xref py py-attr docutils literal"><span class="pre">C</span></code> may be used as an alias for
<a class="reference internal" href="#OpenSSL.crypto.X509Name.countryName" title="OpenSSL.crypto.X509Name.countryName"><code class="xref py py-attr docutils literal"><span class="pre">countryName</span></code></a>.</p>
</dd></dl>
<dl class="attribute">
<dt id="OpenSSL.crypto.X509Name.stateOrProvinceName">
<code class="descclassname">X509Name.</code><code class="descname">stateOrProvinceName</code><a class="headerlink" href="#OpenSSL.crypto.X509Name.stateOrProvinceName" title="Permalink to this definition">¶</a></dt>
<dd><p>The state or province of the entity. <code class="xref py py-attr docutils literal"><span class="pre">ST</span></code> may be used as an alias for
<a class="reference internal" href="#OpenSSL.crypto.X509Name.stateOrProvinceName" title="OpenSSL.crypto.X509Name.stateOrProvinceName"><code class="xref py py-attr docutils literal"><span class="pre">stateOrProvinceName</span></code></a>.</p>
</dd></dl>
<dl class="attribute">
<dt id="OpenSSL.crypto.X509Name.localityName">
<code class="descclassname">X509Name.</code><code class="descname">localityName</code><a class="headerlink" href="#OpenSSL.crypto.X509Name.localityName" title="Permalink to this definition">¶</a></dt>
<dd><p>The locality of the entity. <code class="xref py py-attr docutils literal"><span class="pre">L</span></code> may be used as an alias for
<a class="reference internal" href="#OpenSSL.crypto.X509Name.localityName" title="OpenSSL.crypto.X509Name.localityName"><code class="xref py py-attr docutils literal"><span class="pre">localityName</span></code></a>.</p>
</dd></dl>
<dl class="attribute">
<dt id="OpenSSL.crypto.X509Name.organizationName">
<code class="descclassname">X509Name.</code><code class="descname">organizationName</code><a class="headerlink" href="#OpenSSL.crypto.X509Name.organizationName" title="Permalink to this definition">¶</a></dt>
<dd><p>The organization name of the entity. <code class="xref py py-attr docutils literal"><span class="pre">O</span></code> may be used as an alias for
<a class="reference internal" href="#OpenSSL.crypto.X509Name.organizationName" title="OpenSSL.crypto.X509Name.organizationName"><code class="xref py py-attr docutils literal"><span class="pre">organizationName</span></code></a>.</p>
</dd></dl>
<dl class="attribute">
<dt id="OpenSSL.crypto.X509Name.organizationalUnitName">
<code class="descclassname">X509Name.</code><code class="descname">organizationalUnitName</code><a class="headerlink" href="#OpenSSL.crypto.X509Name.organizationalUnitName" title="Permalink to this definition">¶</a></dt>
<dd><p>The organizational unit of the entity. <code class="xref py py-attr docutils literal"><span class="pre">OU</span></code> may be used as an alias for
<a class="reference internal" href="#OpenSSL.crypto.X509Name.organizationalUnitName" title="OpenSSL.crypto.X509Name.organizationalUnitName"><code class="xref py py-attr docutils literal"><span class="pre">organizationalUnitName</span></code></a>.</p>
</dd></dl>
<dl class="attribute">
<dt id="OpenSSL.crypto.X509Name.commonName">
<code class="descclassname">X509Name.</code><code class="descname">commonName</code><a class="headerlink" href="#OpenSSL.crypto.X509Name.commonName" title="Permalink to this definition">¶</a></dt>
<dd><p>The common name of the entity. <code class="xref py py-attr docutils literal"><span class="pre">CN</span></code> may be used as an alias for
<a class="reference internal" href="#OpenSSL.crypto.X509Name.commonName" title="OpenSSL.crypto.X509Name.commonName"><code class="xref py py-attr docutils literal"><span class="pre">commonName</span></code></a>.</p>
</dd></dl>
<dl class="attribute">
<dt id="OpenSSL.crypto.X509Name.emailAddress">
<code class="descclassname">X509Name.</code><code class="descname">emailAddress</code><a class="headerlink" href="#OpenSSL.crypto.X509Name.emailAddress" title="Permalink to this definition">¶</a></dt>
<dd><p>The e-mail address of the entity.</p>
</dd></dl>
</div>
<div class="section" id="x509req-objects">
<span id="openssl-x509req"></span><h2>X509Req objects<a class="headerlink" href="#x509req-objects" title="Permalink to this headline">¶</a></h2>
<p>X509Req objects have the following methods:</p>
<dl class="method">
<dt id="OpenSSL.crypto.X509Req.get_pubkey">
<code class="descclassname">X509Req.</code><code class="descname">get_pubkey</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509Req.get_pubkey" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a <a class="reference internal" href="#OpenSSL.crypto.PKey" title="OpenSSL.crypto.PKey"><code class="xref py py-class docutils literal"><span class="pre">PKey</span></code></a> object representing the public key of the certificate request.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509Req.get_subject">
<code class="descclassname">X509Req.</code><code class="descname">get_subject</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509Req.get_subject" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an <a class="reference internal" href="#OpenSSL.crypto.X509Name" title="OpenSSL.crypto.X509Name"><code class="xref py py-class docutils literal"><span class="pre">X509Name</span></code></a> object representing the subject of the certificate.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509Req.set_pubkey">
<code class="descclassname">X509Req.</code><code class="descname">set_pubkey</code><span class="sig-paren">(</span><em>pkey</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509Req.set_pubkey" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the public key of the certificate request to <em>pkey</em>.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509Req.sign">
<code class="descclassname">X509Req.</code><code class="descname">sign</code><span class="sig-paren">(</span><em>pkey</em>, <em>digest</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509Req.sign" title="Permalink to this definition">¶</a></dt>
<dd><p>Sign the certificate request, using the key <em>pkey</em> and the message digest
algorithm identified by the string <em>digest</em>.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509Req.verify">
<code class="descclassname">X509Req.</code><code class="descname">verify</code><span class="sig-paren">(</span><em>pkey</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509Req.verify" title="Permalink to this definition">¶</a></dt>
<dd><p>Verify a certificate request using the public key <em>pkey</em>.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509Req.set_version">
<code class="descclassname">X509Req.</code><code class="descname">set_version</code><span class="sig-paren">(</span><em>version</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509Req.set_version" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the version (RFC 2459, 4.1.2.1) of the certificate request to
<em>version</em>.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509Req.get_version">
<code class="descclassname">X509Req.</code><code class="descname">get_version</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509Req.get_version" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the version (RFC 2459, 4.1.2.1) of the certificate request.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509Req.get_extensions">
<code class="descclassname">X509Req.</code><code class="descname">get_extensions</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509Req.get_extensions" title="Permalink to this definition">¶</a></dt>
<dd><p>Get extensions to the request.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.15.</span></p>
</div>
</dd></dl>
</div>
<div class="section" id="x509store-objects">
<span id="openssl-x509store"></span><h2>X509Store objects<a class="headerlink" href="#x509store-objects" title="Permalink to this headline">¶</a></h2>
<p>The X509Store object has currently just one method:</p>
<dl class="method">
<dt id="OpenSSL.crypto.X509Store.add_cert">
<code class="descclassname">X509Store.</code><code class="descname">add_cert</code><span class="sig-paren">(</span><em>cert</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509Store.add_cert" title="Permalink to this definition">¶</a></dt>
<dd><p>Add the certificate <em>cert</em> to the certificate store.</p>
</dd></dl>
</div>
<div class="section" id="x509storecontexterror-objects">
<h2>X509StoreContextError objects<a class="headerlink" href="#x509storecontexterror-objects" title="Permalink to this headline">¶</a></h2>
<p>The X509StoreContextError is an exception raised from
<cite>X509StoreContext.verify_certificate</cite> in circumstances where a certificate
cannot be verified in a provided context.</p>
<p>The certificate for which the verification error was detected is given by the
<code class="docutils literal"><span class="pre">certificate</span></code> attribute of the exception instance as a <a class="reference internal" href="#OpenSSL.crypto.X509" title="OpenSSL.crypto.X509"><code class="xref py py-class docutils literal"><span class="pre">X509</span></code></a>
instance.</p>
<p>Details about the verification error are given in the exception’s <code class="docutils literal"><span class="pre">args</span></code> attribute.</p>
</div>
<div class="section" id="x509storecontext-objects">
<h2>X509StoreContext objects<a class="headerlink" href="#x509storecontext-objects" title="Permalink to this headline">¶</a></h2>
<p>The X509StoreContext object is used for verifying a certificate against a set
of trusted certificates.</p>
<dl class="method">
<dt id="OpenSSL.crypto.X509StoreContext.verify_certificate">
<code class="descclassname">X509StoreContext.</code><code class="descname">verify_certificate</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509StoreContext.verify_certificate" title="Permalink to this definition">¶</a></dt>
<dd><p>Verify a certificate in the context of this initialized <cite>X509StoreContext</cite>.
On error, raises <cite>X509StoreContextError</cite>, otherwise does nothing.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.15.</span></p>
</div>
</dd></dl>
</div>
<div class="section" id="pkey-objects">
<span id="openssl-pkey"></span><h2>PKey objects<a class="headerlink" href="#pkey-objects" title="Permalink to this headline">¶</a></h2>
<p>The PKey object has the following methods:</p>
<dl class="method">
<dt id="OpenSSL.crypto.PKey.bits">
<code class="descclassname">PKey.</code><code class="descname">bits</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.PKey.bits" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the number of bits of the key.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.PKey.generate_key">
<code class="descclassname">PKey.</code><code class="descname">generate_key</code><span class="sig-paren">(</span><em>type</em>, <em>bits</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.PKey.generate_key" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a public/private key pair of the type <em>type</em> (one of
<a class="reference internal" href="#OpenSSL.crypto.TYPE_RSA" title="OpenSSL.crypto.TYPE_RSA"><code class="xref py py-const docutils literal"><span class="pre">TYPE_RSA</span></code></a> and <a class="reference internal" href="#OpenSSL.crypto.TYPE_DSA" title="OpenSSL.crypto.TYPE_DSA"><code class="xref py py-const docutils literal"><span class="pre">TYPE_DSA</span></code></a>) with the size <em>bits</em>.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.PKey.type">
<code class="descclassname">PKey.</code><code class="descname">type</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.PKey.type" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the type of the key.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.PKey.check">
<code class="descclassname">PKey.</code><code class="descname">check</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.PKey.check" title="Permalink to this definition">¶</a></dt>
<dd><p>Check the consistency of this key, returning True if it is consistent and
raising an exception otherwise. This is only valid for RSA keys. See the
OpenSSL RSA_check_key man page for further limitations.</p>
</dd></dl>
</div>
<div class="section" id="pkcs7-objects">
<span id="openssl-pkcs7"></span><h2>PKCS7 objects<a class="headerlink" href="#pkcs7-objects" title="Permalink to this headline">¶</a></h2>
<p>PKCS7 objects have the following methods:</p>
<dl class="method">
<dt id="OpenSSL.crypto.PKCS7.type_is_signed">
<code class="descclassname">PKCS7.</code><code class="descname">type_is_signed</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.PKCS7.type_is_signed" title="Permalink to this definition">¶</a></dt>
<dd><p>FIXME</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.PKCS7.type_is_enveloped">
<code class="descclassname">PKCS7.</code><code class="descname">type_is_enveloped</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.PKCS7.type_is_enveloped" title="Permalink to this definition">¶</a></dt>
<dd><p>FIXME</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.PKCS7.type_is_signedAndEnveloped">
<code class="descclassname">PKCS7.</code><code class="descname">type_is_signedAndEnveloped</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.PKCS7.type_is_signedAndEnveloped" title="Permalink to this definition">¶</a></dt>
<dd><p>FIXME</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.PKCS7.type_is_data">
<code class="descclassname">PKCS7.</code><code class="descname">type_is_data</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.PKCS7.type_is_data" title="Permalink to this definition">¶</a></dt>
<dd><p>FIXME</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.PKCS7.get_type_name">
<code class="descclassname">PKCS7.</code><code class="descname">get_type_name</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.PKCS7.get_type_name" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the type name of the PKCS7.</p>
</dd></dl>
</div>
<div class="section" id="pkcs12-objects">
<span id="openssl-pkcs12"></span><h2>PKCS12 objects<a class="headerlink" href="#pkcs12-objects" title="Permalink to this headline">¶</a></h2>
<p>PKCS12 objects have the following methods:</p>
<dl class="method">
<dt id="OpenSSL.crypto.PKCS12.export">
<code class="descclassname">PKCS12.</code><code class="descname">export</code><span class="sig-paren">(</span><em>[passphrase=None][, iter=2048][, maciter=1]</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.PKCS12.export" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a PKCS12 object as a string.</p>
<p>The optional <em>passphrase</em> must be a string not a callback.</p>
<p>See also the man page for the C function <code class="xref py py-func docutils literal"><span class="pre">PKCS12_create()</span></code>.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.PKCS12.get_ca_certificates">
<code class="descclassname">PKCS12.</code><code class="descname">get_ca_certificates</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.PKCS12.get_ca_certificates" title="Permalink to this definition">¶</a></dt>
<dd><p>Return CA certificates within the PKCS12 object as a tuple. Returns
<code class="xref py py-const docutils literal"><span class="pre">None</span></code> if no CA certificates are present.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.PKCS12.get_certificate">
<code class="descclassname">PKCS12.</code><code class="descname">get_certificate</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.PKCS12.get_certificate" title="Permalink to this definition">¶</a></dt>
<dd><p>Return certificate portion of the PKCS12 structure.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.PKCS12.get_friendlyname">
<code class="descclassname">PKCS12.</code><code class="descname">get_friendlyname</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.PKCS12.get_friendlyname" title="Permalink to this definition">¶</a></dt>
<dd><p>Return friendlyName portion of the PKCS12 structure.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.PKCS12.get_privatekey">
<code class="descclassname">PKCS12.</code><code class="descname">get_privatekey</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.PKCS12.get_privatekey" title="Permalink to this definition">¶</a></dt>
<dd><p>Return private key portion of the PKCS12 structure</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.PKCS12.set_ca_certificates">
<code class="descclassname">PKCS12.</code><code class="descname">set_ca_certificates</code><span class="sig-paren">(</span><em>cacerts</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.PKCS12.set_ca_certificates" title="Permalink to this definition">¶</a></dt>
<dd><p>Replace or set the CA certificates within the PKCS12 object with the sequence <em>cacerts</em>.</p>
<p>Set <em>cacerts</em> to <code class="xref py py-const docutils literal"><span class="pre">None</span></code> to remove all CA certificates.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.PKCS12.set_certificate">
<code class="descclassname">PKCS12.</code><code class="descname">set_certificate</code><span class="sig-paren">(</span><em>cert</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.PKCS12.set_certificate" title="Permalink to this definition">¶</a></dt>
<dd><p>Replace or set the certificate portion of the PKCS12 structure.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.PKCS12.set_friendlyname">
<code class="descclassname">PKCS12.</code><code class="descname">set_friendlyname</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.PKCS12.set_friendlyname" title="Permalink to this definition">¶</a></dt>
<dd><p>Replace or set the friendlyName portion of the PKCS12 structure.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.PKCS12.set_privatekey">
<code class="descclassname">PKCS12.</code><code class="descname">set_privatekey</code><span class="sig-paren">(</span><em>pkey</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.PKCS12.set_privatekey" title="Permalink to this definition">¶</a></dt>
<dd><p>Replace or set private key portion of the PKCS12 structure</p>
</dd></dl>
</div>
<div class="section" id="x509extension-objects">
<span id="openssl-509ext"></span><h2>X509Extension objects<a class="headerlink" href="#x509extension-objects" title="Permalink to this headline">¶</a></h2>
<p>X509Extension objects have several methods:</p>
<dl class="method">
<dt id="OpenSSL.crypto.X509Extension.get_critical">
<code class="descclassname">X509Extension.</code><code class="descname">get_critical</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509Extension.get_critical" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the critical field of the extension object.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509Extension.get_short_name">
<code class="descclassname">X509Extension.</code><code class="descname">get_short_name</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509Extension.get_short_name" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve the short descriptive name for this extension.</p>
<p>The result is a byte string like <code class="xref py py-const docutils literal"><span class="pre">basicConstraints</span></code>.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.12.</span></p>
</div>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.X509Extension.get_data">
<code class="descclassname">X509Extension.</code><code class="descname">get_data</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.X509Extension.get_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve the data for this extension.</p>
<p>The result is the ASN.1 encoded form of the extension data as a byte string.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.12.</span></p>
</div>
</dd></dl>
</div>
<div class="section" id="netscapespki-objects">
<span id="openssl-netscape-spki"></span><h2>NetscapeSPKI objects<a class="headerlink" href="#netscapespki-objects" title="Permalink to this headline">¶</a></h2>
<p>NetscapeSPKI objects have the following methods:</p>
<dl class="method">
<dt id="OpenSSL.crypto.NetscapeSPKI.b64_encode">
<code class="descclassname">NetscapeSPKI.</code><code class="descname">b64_encode</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.NetscapeSPKI.b64_encode" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a base64-encoded string representation of the object.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.NetscapeSPKI.get_pubkey">
<code class="descclassname">NetscapeSPKI.</code><code class="descname">get_pubkey</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.NetscapeSPKI.get_pubkey" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the public key of object.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.NetscapeSPKI.set_pubkey">
<code class="descclassname">NetscapeSPKI.</code><code class="descname">set_pubkey</code><span class="sig-paren">(</span><em>key</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.NetscapeSPKI.set_pubkey" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the public key of the object to <em>key</em>.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.NetscapeSPKI.sign">
<code class="descclassname">NetscapeSPKI.</code><code class="descname">sign</code><span class="sig-paren">(</span><em>key</em>, <em>digest_name</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.NetscapeSPKI.sign" title="Permalink to this definition">¶</a></dt>
<dd><p>Sign the NetscapeSPKI object using the given <em>key</em> and <em>digest_name</em>.
<em>digest_name</em> must be a string describing a digest algorithm supported by
OpenSSL (by EVP_get_digestbyname, specifically). For example,
<code class="xref py py-const docutils literal"><span class="pre">"md5"</span></code> or <code class="xref py py-const docutils literal"><span class="pre">"sha1"</span></code>.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.NetscapeSPKI.verify">
<code class="descclassname">NetscapeSPKI.</code><code class="descname">verify</code><span class="sig-paren">(</span><em>key</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.NetscapeSPKI.verify" title="Permalink to this definition">¶</a></dt>
<dd><p>Verify the NetscapeSPKI object using the given <em>key</em>.</p>
</dd></dl>
</div>
<div class="section" id="crl-objects">
<span id="crl"></span><h2>CRL objects<a class="headerlink" href="#crl-objects" title="Permalink to this headline">¶</a></h2>
<p>CRL objects have the following methods:</p>
<dl class="method">
<dt id="OpenSSL.crypto.CRL.add_revoked">
<code class="descclassname">CRL.</code><code class="descname">add_revoked</code><span class="sig-paren">(</span><em>revoked</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.CRL.add_revoked" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a Revoked object to the CRL, by value not reference.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.CRL.export">
<code class="descclassname">CRL.</code><code class="descname">export</code><span class="sig-paren">(</span><em>cert, key[, type=FILETYPE_PEM][, days=100][, digest=b'md5']</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.CRL.export" title="Permalink to this definition">¶</a></dt>
<dd><p>Use <em>cert</em> and <em>key</em> to sign the CRL and return the CRL as a string.
<em>days</em> is the number of days before the next CRL is due.
<em>digest</em> is the algorithm that will be used to sign CRL.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.CRL.get_revoked">
<code class="descclassname">CRL.</code><code class="descname">get_revoked</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.CRL.get_revoked" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a tuple of Revoked objects, by value not reference.</p>
</dd></dl>
</div>
<div class="section" id="revoked-objects">
<span id="revoked"></span><h2>Revoked objects<a class="headerlink" href="#revoked-objects" title="Permalink to this headline">¶</a></h2>
<p>Revoked objects have the following methods:</p>
<dl class="method">
<dt id="OpenSSL.crypto.Revoked.all_reasons">
<code class="descclassname">Revoked.</code><code class="descname">all_reasons</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.Revoked.all_reasons" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a list of all supported reasons.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.Revoked.get_reason">
<code class="descclassname">Revoked.</code><code class="descname">get_reason</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.Revoked.get_reason" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the revocation reason as a str. Can be
None, which differs from “Unspecified”.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.Revoked.get_rev_date">
<code class="descclassname">Revoked.</code><code class="descname">get_rev_date</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.Revoked.get_rev_date" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the revocation date as a str.
The string is formatted as an ASN1 GENERALIZEDTIME.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.Revoked.get_serial">
<code class="descclassname">Revoked.</code><code class="descname">get_serial</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.Revoked.get_serial" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a str containing a hex number of the serial of the revoked certificate.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.Revoked.set_reason">
<code class="descclassname">Revoked.</code><code class="descname">set_reason</code><span class="sig-paren">(</span><em>reason</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.Revoked.set_reason" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the revocation reason. <em>reason</em> must be None or a string, but the
values are limited. Spaces and case are ignored. See
<a class="reference internal" href="#OpenSSL.crypto.Revoked.all_reasons" title="OpenSSL.crypto.Revoked.all_reasons"><code class="xref py py-meth docutils literal"><span class="pre">all_reasons()</span></code></a>.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.Revoked.set_rev_date">
<code class="descclassname">Revoked.</code><code class="descname">set_rev_date</code><span class="sig-paren">(</span><em>date</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.Revoked.set_rev_date" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the revocation date.
The string is formatted as an ASN1 GENERALIZEDTIME.</p>
</dd></dl>
<dl class="method">
<dt id="OpenSSL.crypto.Revoked.set_serial">
<code class="descclassname">Revoked.</code><code class="descname">set_serial</code><span class="sig-paren">(</span><em>serial</em><span class="sig-paren">)</span><a class="headerlink" href="#OpenSSL.crypto.Revoked.set_serial" title="Permalink to this definition">¶</a></dt>
<dd><p><em>serial</em> is a string containing a hex number of the serial of the revoked certificate.</p>
</dd></dl>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#"><code class="docutils literal"><span class="pre">crypto</span></code> — Generic cryptographic module</a><ul>
<li><a class="reference internal" href="#x509-objects">X509 objects</a></li>
<li><a class="reference internal" href="#x509name-objects">X509Name objects</a></li>
<li><a class="reference internal" href="#x509req-objects">X509Req objects</a></li>
<li><a class="reference internal" href="#x509store-objects">X509Store objects</a></li>
<li><a class="reference internal" href="#x509storecontexterror-objects">X509StoreContextError objects</a></li>
<li><a class="reference internal" href="#x509storecontext-objects">X509StoreContext objects</a></li>
<li><a class="reference internal" href="#pkey-objects">PKey objects</a></li>
<li><a class="reference internal" href="#pkcs7-objects">PKCS7 objects</a></li>
<li><a class="reference internal" href="#pkcs12-objects">PKCS12 objects</a></li>
<li><a class="reference internal" href="#x509extension-objects">X509Extension objects</a></li>
<li><a class="reference internal" href="#netscapespki-objects">NetscapeSPKI objects</a></li>
<li><a class="reference internal" href="#crl-objects">CRL objects</a></li>
<li><a class="reference internal" href="#revoked-objects">Revoked objects</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="../api.html"
title="previous chapter"><code class="docutils literal"><span class="pre">OpenSSL</span></code> — Python interface to OpenSSL</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="rand.html"
title="next chapter"><code class="docutils literal"><span class="pre">rand</span></code> — An interface to the OpenSSL pseudo random number generator</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/api/crypto.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="rand.html" title="rand — An interface to the OpenSSL pseudo random number generator"
>next</a> |</li>
<li class="right" >
<a href="../api.html" title="OpenSSL — Python interface to OpenSSL"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">pyOpenSSL 0.15.1 documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="../api.html" ><code class="docutils literal"><span class="pre">OpenSSL</span></code> — Python interface to OpenSSL</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2011, Jean-Paul Calderone.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
</div>
</body>
</html>
|