blob: ac8e0b1b3e2fae5db7faf79f48da786952f8bdfe [file] [log] [blame]
Jean-Paul Calderone897bc252008-02-18 20:50:23 -05001<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<html>
3<head>
4<title>3.1 crypto -- Generic cryptographic module </title>
5<META NAME="description" CONTENT="3.1 crypto -- Generic cryptographic module ">
6<META NAME="keywords" CONTENT="pyOpenSSL">
7<META NAME="resource-type" CONTENT="document">
8<META NAME="distribution" CONTENT="global">
9<link rel="STYLESHEET" href="pyOpenSSL.css">
10<LINK REL="next" href="openssl-rand.html">
11<LINK REL="previous" href="openssl.html">
12<LINK REL="up" href="openssl.html">
13<LINK REL="next" href="openssl-x509.html">
14</head>
15<body>
16<DIV CLASS="navigation">
17<table align="center" width="100%" cellpadding="0" cellspacing="2">
18<tr>
19<td><A href="openssl.html"><img src="previous.gif"
20border="0" height="32"
21 alt="Previous Page" width="32"></A></td>
22<td><A href="openssl.html"><img src="up.gif"
23border="0" height="32"
24 alt="Up One Level" width="32"></A></td>
25<td><A href="openssl-x509.html"><img src="next.gif"
26border="0" height="32"
27 alt="Next Page" width="32"></A></td>
28<td align="center" width="100%">Python OpenSSL Manual</td>
29<td><A href="contents.html"><img src="contents.gif"
30border="0" height="32"
31 alt="Contents" width="32"></A></td>
32<td><img src="blank.gif"
33 border="0" height="32"
34 alt="" width="32"></td>
35<td><img src="blank.gif"
36 border="0" height="32"
37 alt="" width="32"></td>
38</tr></table>
39<b class="navlabel">Previous:</b> <a class="sectref" href="openssl.html">3 OpenSSL </A>
40<b class="navlabel">Up:</b> <a class="sectref" href="openssl.html">3 OpenSSL </A>
41<b class="navlabel">Next:</b> <a class="sectref" href="openssl-x509.html">3.1.1 X509 objects</A>
42<br><hr>
43</DIV>
44<!--End of Navigation Panel-->
45<H2><A NAME="SECTION000410000000000000000">&nbsp;</A>
46<BR>
473.1 <tt class="module">crypto</tt> -- Generic cryptographic module
48</H2>
49
50<P>
51
52
53<P>
54<dl><dt><b><a name='l2h-6'><tt>X509Type</tt></a></b>
55<dd>
56A Python type object representing the X509 object type.
57</dl>
58
59<P>
60<dl><dt><b><a name='l2h-7'><tt class='function'>X509</tt></a></b>()
61<dd>
62Factory function that creates an X509 object.
63</dl>
64
65<P>
66<dl><dt><b><a name='l2h-8'><tt>X509NameType</tt></a></b>
67<dd>
68A Python type object representing the X509Name object type.
69</dl>
70
71<P>
72<dl><dt><b><a name='l2h-9'><tt class='function'>X509Name</tt></a></b>(<var>x509name</var>)
73<dd>
74Factory function that creates a copy of <var>x509name</var>.
75</dl>
76
77<P>
78<dl><dt><b><a name='l2h-10'><tt>X509ReqType</tt></a></b>
79<dd>
80A Python type object representing the X509Req object type.
81</dl>
82
83<P>
84<dl><dt><b><a name='l2h-11'><tt class='function'>X509Req</tt></a></b>()
85<dd>
86Factory function that creates an X509Req object.
87</dl>
88
89<P>
90<dl><dt><b><a name='l2h-12'><tt>X509StoreType</tt></a></b>
91<dd>
92A Python type object representing the X509Store object type.
93</dl>
94
95<P>
96<dl><dt><b><a name='l2h-13'><tt>PKeyType</tt></a></b>
97<dd>
98A Python type object representing the PKey object type.
99</dl>
100
101<P>
102<dl><dt><b><a name='l2h-14'><tt class='function'>PKey</tt></a></b>()
103<dd>
104Factory function that creates a PKey object.
105</dl>
106
107<P>
108<dl><dt><b><a name='l2h-15'><tt>PKCS7Type</tt></a></b>
109<dd>
110A Python type object representing the PKCS7 object type.
111</dl>
112
113<P>
114<dl><dt><b><a name='l2h-16'><tt>PKCS12Type</tt></a></b>
115<dd>
116A Python type object representing the PKCS12 object type.
117</dl>
118
119<P>
120<dl><dt><b><a name='l2h-17'><tt>X509ExtensionType</tt></a></b>
121<dd>
122A Python type object representing the X509Extension object type.
123</dl>
124
125<P>
126<dl><dt><b><a name='l2h-18'><tt class='function'>X509Extension</tt></a></b>(<var>typename, critical, value</var>)
127<dd>
128Factory function that creates a X509Extension object.
129</dl>
130
131<P>
132<dl><dt><b><a name='l2h-19'><tt>NetscapeSPKIType</tt></a></b>
133<dd>
134A Python type object representing the NetscapeSPKI object type.
135</dl>
136
137<P>
138<dl><dt><b><a name='l2h-20'><tt class='function'>NetscapeSPKI</tt></a></b>(<big>[</big><var>enc</var><big>]</big>)
139<dd>
140Factory function that creates a NetscapeSPKI object. If the <var>enc</var> argument
141is present, it should be a base64-encoded string representing a NetscapeSPKI
142object, as returned by the <tt class="method">b64_encode</tt> method.
143</dl>
144
145<P>
146<dl><dt><b><a name='l2h-21'><tt>FILETYPE_PEM</tt></a></b>
147<dd>
148<dt><b><a name='l2h-32'><tt>FILETYPE_ASN1</tt></a></b><dd>
149File type constants.
150</dl>
151
152<P>
153<dl><dt><b><a name='l2h-22'><tt>TYPE_RSA</tt></a></b>
154<dd>
155<dt><b><a name='l2h-33'><tt>TYPE_DSA</tt></a></b><dd>
156Key type constants.
157</dl>
158
159<P>
160<dl><dt><b>exception <a name='l2h-23'><tt class='exception'>Error</tt></a></b>
161<dd>
162Generic exception used in the <tt class="module">crypto</tt> module.
163</dl>
164
165<P>
166<dl><dt><b><a name='l2h-24'><tt class='function'>dump_certificate</tt></a></b>(<var>type, cert</var>)
167<dd>
168Dump the certificate <var>cert</var> into a buffer string encoded with the type
169<var>type</var>.
170</dl>
171
172<P>
173<dl><dt><b><a name='l2h-25'><tt class='function'>dump_certificate_request</tt></a></b>(<var>type, req</var>)
174<dd>
175Dump the certificate request <var>req</var> into a buffer string encoded with the
176type <var>type</var>.
177</dl>
178
179<P>
180<dl><dt><b><a name='l2h-26'><tt class='function'>dump_privatekey</tt></a></b>(<var>type, pkey</var><big>[</big><var>, cipher, passphrase</var><big>]</big>)
181<dd>
182Dump the private key <var>pkey</var> into a buffer string encoded with the type
183<var>type</var>, optionally (if <var>type</var> is <tt class="constant">FILETYPE_PEM</tt>) encrypting it
184using <var>cipher</var> and <var>passphrase</var>.
185
186<P>
187<var>passphrase</var> must be either a string or a callback for providing the
188pass phrase.
189</dl>
190
191<P>
192<dl><dt><b><a name='l2h-27'><tt class='function'>load_certificate</tt></a></b>(<var>type, buffer</var>)
193<dd>
194Load a certificate (X509) from the string <var>buffer</var> encoded with the
195type <var>type</var>.
196</dl>
197
198<P>
199<dl><dt><b><a name='l2h-28'><tt class='function'>load_certificate_request</tt></a></b>(<var>type, buffer</var>)
200<dd>
201Load a certificate request (X509Req) from the string <var>buffer</var> encoded with
202the type <var>type</var>.
203</dl>
204
205<P>
206<dl><dt><b><a name='l2h-29'><tt class='function'>load_privatekey</tt></a></b>(<var>type, buffer</var><big>[</big><var>, passphrase</var><big>]</big>)
207<dd>
208Load a private key (PKey) from the string <var>buffer</var> encoded with
209the type <var>type</var> (must be one of <tt class="constant">FILETYPE_PEM</tt> and
210<tt class="constant">FILETYPE_ASN1</tt>).
211
212<P>
213<var>passphrase</var> must be either a string or a callback for providing the
214pass phrase.
215</dl>
216
217<P>
218<dl><dt><b><a name='l2h-30'><tt class='function'>load_pkcs7_data</tt></a></b>(<var>type, buffer</var>)
219<dd>
220Load pkcs7 data from the string <var>buffer</var> encoded with the type <var>type</var>.
221</dl>
222
223<P>
224<dl><dt><b><a name='l2h-31'><tt class='function'>load_pkcs12</tt></a></b>(<var>buffer</var><big>[</big><var>, passphrase</var><big>]</big>)
225<dd>
226Load pkcs12 data from the string <var>buffer</var>. If the pkcs12 structure is
227encrypted, a <var>passphrase</var> must be included.
228</dl>
229
230<P>
231
232<p><hr>
233
234<!--Table of Child-Links-->
235<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
236
237<UL CLASS="ChildLinks">
238<LI><A NAME="tex2html137"
239 href="openssl-x509.html">3.1.1 X509 objects </A>
240<LI><A NAME="tex2html138"
241 href="openssl-x509name.html">3.1.2 X509Name objects </A>
242<LI><A NAME="tex2html139"
243 href="openssl-x509req.html">3.1.3 X509Req objects </A>
244<LI><A NAME="tex2html140"
245 href="openssl-x509store.html">3.1.4 X509Store objects </A>
246<LI><A NAME="tex2html141"
247 href="openssl-pkey.html">3.1.5 PKey objects </A>
248<LI><A NAME="tex2html142"
249 href="openssl-pkcs7.html">3.1.6 PKCS7 objects </A>
250<LI><A NAME="tex2html143"
251 href="openssl-pkcs12.html">3.1.7 PKCS12 objects </A>
252<LI><A NAME="tex2html144"
253 href="openssl-509ext.html">3.1.8 X509Extension objects </A>
254<LI><A NAME="tex2html145"
255 href="openssl-netscape-spki.html">3.1.9 NetscapeSPKI objects </A>
256</UL>
257<!--End of Table of Child-Links-->
258
259<DIV CLASS="navigation">
260<p><hr>
261<table align="center" width="100%" cellpadding="0" cellspacing="2">
262<tr>
263<td><A href="openssl.html"><img src="previous.gif"
264border="0" height="32"
265 alt="Previous Page" width="32"></A></td>
266<td><A href="openssl.html"><img src="up.gif"
267border="0" height="32"
268 alt="Up One Level" width="32"></A></td>
269<td><A href="openssl-x509.html"><img src="next.gif"
270border="0" height="32"
271 alt="Next Page" width="32"></A></td>
272<td align="center" width="100%">Python OpenSSL Manual</td>
273<td><A href="contents.html"><img src="contents.gif"
274border="0" height="32"
275 alt="Contents" width="32"></A></td>
276<td><img src="blank.gif"
277 border="0" height="32"
278 alt="" width="32"></td>
279<td><img src="blank.gif"
280 border="0" height="32"
281 alt="" width="32"></td>
282</tr></table>
283<b class="navlabel">Previous:</b> <a class="sectref" href="openssl.html">3 OpenSSL </A>
284<b class="navlabel">Up:</b> <a class="sectref" href="openssl.html">3 OpenSSL </A>
285<b class="navlabel">Next:</b> <a class="sectref" href="openssl-x509.html">3.1.1 X509 objects</A>
286<hr>
287<span class="release-info">Release 0.6.</span>
288</DIV>
289<!--End of Navigation Panel-->
290
291</BODY>
292</HTML>