blob: ce7c97017f14c7ac0c8acc8996583c22132f1363 [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.7 PKCS12 objects </title>
5<META NAME="description" CONTENT="3.1.7 PKCS12 objects ">
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-509ext.html">
11<LINK REL="previous" href="openssl-pkcs7.html">
12<LINK REL="up" href="openssl-crypto.html">
13<LINK REL="next" href="openssl-509ext.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-pkcs7.html"><img src="previous.gif"
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -050020 border="0" height="32"
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050021 alt="Previous Page" width="32"></A></td>
22<td><A href="openssl-crypto.html"><img src="up.gif"
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -050023 border="0" height="32"
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050024 alt="Up One Level" width="32"></A></td>
25<td><A href="openssl-509ext.html"><img src="next.gif"
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -050026 border="0" height="32"
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050027 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"
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -050030 border="0" height="32"
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050031 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-pkcs7.html">3.1.6 PKCS7 objects</A>
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-509ext.html">3.1.8 X509Extension objects</A>
42<br><hr>
43</DIV>
44<!--End of Navigation Panel-->
45
46<H3><A NAME="SECTION000417000000000000000">&nbsp;</A>
47<BR>
483.1.7 PKCS12 objects
49</H3>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -050050
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050051<P>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -050052PKCS12 objects have the following methods:
53
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050054<P>
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -050055<dl><dt><b><a name='l2h-81'><tt class='method'>export</tt></a></b>(<big>[</big><var>passphrase=None</var><big>]</big><big>[</big><var>, iter=2048</var><big>]</big><big>[</big><var>, maciter=1</var><big>]</big>)
56<dd>
57Returns a PKCS12 object as a string.
58
59<P>
60The optional <var>passphrase</var> must be a string not a callback.
61
62<P>
63See also the man page for the C function <tt class="function">PKCS12_create</tt>.
64</dl>
65
66<P>
67<dl><dt><b><a name='l2h-82'><tt class='method'>get_ca_certificates</tt></a></b>()
68<dd>
69Return CA certificates within the PKCS12 object as a tuple. Returns
70<tt class="constant">None</tt> if no CA certificates are present.
71</dl>
72
73<P>
74<dl><dt><b><a name='l2h-83'><tt class='method'>get_certificate</tt></a></b>()
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050075<dd>
76Return certificate portion of the PKCS12 structure.
77</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -050078
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050079<P>
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -050080<dl><dt><b><a name='l2h-84'><tt class='method'>get_friendlyname</tt></a></b>()
81<dd>
82Return friendlyName portion of the PKCS12 structure.
83</dl>
84
85<P>
86<dl><dt><b><a name='l2h-85'><tt class='method'>get_privatekey</tt></a></b>()
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050087<dd>
88Return private key portion of the PKCS12 structure
89</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -050090
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050091<P>
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -050092<dl><dt><b><a name='l2h-86'><tt class='method'>set_ca_certificates</tt></a></b>(<var>cacerts</var>)
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050093<dd>
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -050094Replace or set the CA certificates within the PKCS12 object with the sequence <var>cacerts</var>.
95
96<P>
97Set <var>cacerts</var> to <tt class="constant">None</tt> to remove all CA certificates.
98</dl>
99
100<P>
101<dl><dt><b><a name='l2h-87'><tt class='method'>set_certificate</tt></a></b>(<var>cert</var>)
102<dd>
103Replace or set the certificate portion of the PKCS12 structure.
104</dl>
105
106<P>
107<dl><dt><b><a name='l2h-88'><tt class='method'>set_friendlyname</tt></a></b>(<var>name</var>)
108<dd>
109Replace or set the friendlyName portion of the PKCS12 structure.
110</dl>
111
112<P>
113<dl><dt><b><a name='l2h-89'><tt class='method'>set_privatekey</tt></a></b>(<var>pkey</var>)
114<dd>
115Replace or set private key portion of the PKCS12 structure
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500116</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500117
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500118<P>
119
120<DIV CLASS="navigation">
121<p><hr>
122<table align="center" width="100%" cellpadding="0" cellspacing="2">
123<tr>
124<td><A href="openssl-pkcs7.html"><img src="previous.gif"
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -0500125 border="0" height="32"
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500126 alt="Previous Page" width="32"></A></td>
127<td><A href="openssl-crypto.html"><img src="up.gif"
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -0500128 border="0" height="32"
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500129 alt="Up One Level" width="32"></A></td>
130<td><A href="openssl-509ext.html"><img src="next.gif"
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -0500131 border="0" height="32"
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500132 alt="Next Page" width="32"></A></td>
133<td align="center" width="100%">Python OpenSSL Manual</td>
134<td><A href="contents.html"><img src="contents.gif"
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -0500135 border="0" height="32"
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500136 alt="Contents" width="32"></A></td>
137<td><img src="blank.gif"
138 border="0" height="32"
139 alt="" width="32"></td>
140<td><img src="blank.gif"
141 border="0" height="32"
142 alt="" width="32"></td>
143</tr></table>
144<b class="navlabel">Previous:</b> <a class="sectref" href="openssl-pkcs7.html">3.1.6 PKCS7 objects</A>
145<b class="navlabel">Up:</b> <a class="sectref" href="openssl-crypto.html">3.1 crypto </A>
146<b class="navlabel">Next:</b> <a class="sectref" href="openssl-509ext.html">3.1.8 X509Extension objects</A>
147<hr>
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -0500148<span class="release-info">Release 0.10.</span>
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500149</DIV>
150<!--End of Navigation Panel-->
151
152</BODY>
153</HTML>