1
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
4
<title>3.1.6 PKey objects </title>
5
<META NAME="description" CONTENT="3.1.6 PKey objects ">
4
<title>3.1.5 PKey objects </title>
5
<META NAME="description" CONTENT="3.1.5 PKey objects ">
6
6
<META NAME="keywords" CONTENT="pyOpenSSL">
7
7
<META NAME="resource-type" CONTENT="document">
8
8
<META NAME="distribution" CONTENT="global">
36
36
border="0" height="32"
37
37
alt="" width="32"></td>
39
<b class="navlabel">Previous:</b> <a class="sectref" href="openssl-x509store.html">3.1.5 X509Store objects</A>
39
<b class="navlabel">Previous:</b> <a class="sectref" href="openssl-x509store.html">3.1.4 X509Store objects</A>
40
40
<b class="navlabel">Up:</b> <a class="sectref" href="openssl-crypto.html">3.1 crypto </A>
41
<b class="navlabel">Next:</b> <a class="sectref" href="openssl-pkcs7.html">3.1.7 PKCS7 objects</A>
41
<b class="navlabel">Next:</b> <a class="sectref" href="openssl-pkcs7.html">3.1.6 PKCS7 objects</A>
44
44
<!--End of Navigation Panel-->
46
<H3><A NAME="SECTION000416000000000000000"> </A>
46
<H3><A NAME="SECTION000415000000000000000"> </A>
52
52
The PKey object has the following methods:
55
<dl><dt><b><a name='l2h-82'><tt class='method'>bits</tt></a></b>()
55
<dl><dt><b><a name='l2h-81'><tt class='method'>bits</tt></a></b>()
57
57
Return the number of bits of the key.
61
<dl><dt><b><a name='l2h-83'><tt class='method'>generate_key</tt></a></b>(<var>type, bits</var>)
61
<dl><dt><b><a name='l2h-82'><tt class='method'>generate_key</tt></a></b>(<var>type, bits</var>)
63
63
Generate a public/private key pair of the type <var>type</var> (one of
64
64
<tt class="constant">TYPE_RSA</tt> and <tt class="constant">TYPE_DSA</tt>) with the size <var>bits</var>.
68
<dl><dt><b><a name='l2h-84'><tt class='method'>type</tt></a></b>()
68
<dl><dt><b><a name='l2h-83'><tt class='method'>type</tt></a></b>()
70
70
Return the type of the key.
74
<dl><dt><b><a name='l2h-84'><tt class='method'>check</tt></a></b>()
76
Check the consistency of this key, returning True if it is consistent and
77
raising an exception otherwise. This is only valid for RSA keys. See the
78
OpenSSL RSA_check_key man page for further limitations.
75
83
<DIV CLASS="navigation">
96
104
border="0" height="32"
97
105
alt="" width="32"></td>
99
<b class="navlabel">Previous:</b> <a class="sectref" href="openssl-x509store.html">3.1.5 X509Store objects</A>
107
<b class="navlabel">Previous:</b> <a class="sectref" href="openssl-x509store.html">3.1.4 X509Store objects</A>
100
108
<b class="navlabel">Up:</b> <a class="sectref" href="openssl-crypto.html">3.1 crypto </A>
101
<b class="navlabel">Next:</b> <a class="sectref" href="openssl-pkcs7.html">3.1.7 PKCS7 objects</A>
109
<b class="navlabel">Next:</b> <a class="sectref" href="openssl-pkcs7.html">3.1.6 PKCS7 objects</A>
103
<span class="release-info">Release 0.12.</span>
111
<span class="release-info">Release 0.13.</span>
105
113
<!--End of Navigation Panel-->