~exarkun/pyopenssl/trunk

« back to all changes in this revision

Viewing changes to doc/html/openssl-x509.html

  • Committer: Jean-Paul Calderone
  • Date: 2011-09-11 19:49:43 UTC
  • mfrom: (156.3.22 sphinx-doc)
  • Revision ID: exarkun@divmod.com-20110911194943-ucaan2tzidk7ek5l
Convert the documentation from LaTeX/epytext to Sphinx/ReST

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
 
<html>
3
 
<head>
4
 
<title>3.1.1 X509 objects </title>
5
 
<META NAME="description" CONTENT="3.1.1 X509 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-x509name.html">
11
 
<LINK REL="previous" href="openssl-crypto.html">
12
 
<LINK REL="up" href="openssl-crypto.html">
13
 
<LINK REL="next" href="openssl-x509name.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-crypto.html"><img src="previous.gif"
20
 
  border="0" height="32"
21
 
  alt="Previous Page" width="32"></A></td>
22
 
<td><A href="openssl-crypto.html"><img src="up.gif"
23
 
  border="0" height="32"
24
 
  alt="Up One Level" width="32"></A></td>
25
 
<td><A href="openssl-x509name.html"><img src="next.gif"
26
 
  border="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"
30
 
  border="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-crypto.html">3.1 crypto  </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-x509name.html">3.1.2 X509Name objects</A>
42
 
<br><hr>
43
 
</DIV>
44
 
<!--End of Navigation Panel-->
45
 
 
46
 
<H3><A NAME="SECTION000411000000000000000">&nbsp;</A>
47
 
<BR>
48
 
3.1.1 X509 objects 
49
 
</H3>
50
 
 
51
 
<P>
52
 
X509 objects have the following methods:
53
 
 
54
 
<P>
55
 
<dl><dt><b><a name='l2h-39'><tt class='method'>get_issuer</tt></a></b>()
56
 
<dd>
57
 
Return an X509Name object representing the issuer of the certificate.
58
 
</dl>
59
 
 
60
 
<P>
61
 
<dl><dt><b><a name='l2h-40'><tt class='method'>get_pubkey</tt></a></b>()
62
 
<dd>
63
 
Return a PKey object representing the public key of the certificate.
64
 
</dl>
65
 
 
66
 
<P>
67
 
<dl><dt><b><a name='l2h-41'><tt class='method'>get_serial_number</tt></a></b>()
68
 
<dd>
69
 
Return the certificate serial number.
70
 
</dl>
71
 
 
72
 
<P>
73
 
<dl><dt><b><a name='l2h-42'><tt class='method'>get_signature_algorithm</tt></a></b>()
74
 
<dd>
75
 
Return the signature algorithm used in the certificate.  If the algorithm is
76
 
undefined, raise <code>ValueError</code>.
77
 
</dl>
78
 
 
79
 
<P>
80
 
<dl><dt><b><a name='l2h-43'><tt class='method'>get_subject</tt></a></b>()
81
 
<dd>
82
 
Return an X509Name object representing the subject of the certificate.
83
 
</dl>
84
 
 
85
 
<P>
86
 
<dl><dt><b><a name='l2h-44'><tt class='method'>get_version</tt></a></b>()
87
 
<dd>
88
 
Return the certificate version.
89
 
</dl>
90
 
 
91
 
<P>
92
 
<dl><dt><b><a name='l2h-45'><tt class='method'>get_notBefore</tt></a></b>()
93
 
<dd>
94
 
Return a string giving the time before which the certificate is not valid.  The
95
 
string is formatted as an ASN1 GENERALIZEDTIME:
96
 
<dl><dd><pre class="verbatim">
97
 
                 YYYYMMDDhhmmssZ
98
 
                 YYYYMMDDhhmmss+hhmm
99
 
                 YYYYMMDDhhmmss-hhmm
100
 
</pre></dl>
101
 
If no value exists for this field, <code>None</code> is returned.
102
 
</dl>
103
 
 
104
 
<P>
105
 
<dl><dt><b><a name='l2h-46'><tt class='method'>get_notAfter</tt></a></b>()
106
 
<dd>
107
 
Return a string giving the time after which the certificate is not valid.  The
108
 
string is formatted as an ASN1 GENERALIZEDTIME:
109
 
<dl><dd><pre class="verbatim">
110
 
                 YYYYMMDDhhmmssZ
111
 
                 YYYYMMDDhhmmss+hhmm
112
 
                 YYYYMMDDhhmmss-hhmm
113
 
</pre></dl>
114
 
If no value exists for this field, <code>None</code> is returned.
115
 
</dl>
116
 
 
117
 
<P>
118
 
<dl><dt><b><a name='l2h-47'><tt class='method'>set_notBefore</tt></a></b>(<var>when</var>)
119
 
<dd>
120
 
Change the time before which the certificate is not valid.  <var>when</var> is a
121
 
string formatted as an ASN1 GENERALIZEDTIME:
122
 
<dl><dd><pre class="verbatim">
123
 
                 YYYYMMDDhhmmssZ
124
 
                 YYYYMMDDhhmmss+hhmm
125
 
                 YYYYMMDDhhmmss-hhmm
126
 
</pre></dl>
127
 
</dl>
128
 
 
129
 
<P>
130
 
<dl><dt><b><a name='l2h-48'><tt class='method'>set_notAfter</tt></a></b>(<var>when</var>)
131
 
<dd>
132
 
Change the time after which the certificate is not valid.  <var>when</var> is a
133
 
string formatted as an ASN1 GENERALIZEDTIME:
134
 
<dl><dd><pre class="verbatim">
135
 
                 YYYYMMDDhhmmssZ
136
 
                 YYYYMMDDhhmmss+hhmm
137
 
                 YYYYMMDDhhmmss-hhmm
138
 
</pre></dl>
139
 
</dl>
140
 
 
141
 
<P>
142
 
<dl><dt><b><a name='l2h-49'><tt class='method'>gmtime_adj_notBefore</tt></a></b>(<var>time</var>)
143
 
<dd>
144
 
Adjust the timestamp (in GMT) when the certificate starts being valid.
145
 
</dl>
146
 
 
147
 
<P>
148
 
<dl><dt><b><a name='l2h-50'><tt class='method'>gmtime_adj_notAfter</tt></a></b>(<var>time</var>)
149
 
<dd>
150
 
Adjust the timestamp (in GMT) when the certificate stops being valid.
151
 
</dl>
152
 
 
153
 
<P>
154
 
<dl><dt><b><a name='l2h-51'><tt class='method'>has_expired</tt></a></b>()
155
 
<dd>
156
 
Checks the certificate's time stamp against current time. Returns true if the
157
 
certificate has expired and false otherwise.
158
 
</dl>
159
 
 
160
 
<P>
161
 
<dl><dt><b><a name='l2h-52'><tt class='method'>set_issuer</tt></a></b>(<var>issuer</var>)
162
 
<dd>
163
 
Set the issuer of the certificate to <var>issuer</var>.
164
 
</dl>
165
 
 
166
 
<P>
167
 
<dl><dt><b><a name='l2h-53'><tt class='method'>set_pubkey</tt></a></b>(<var>pkey</var>)
168
 
<dd>
169
 
Set the public key of the certificate to <var>pkey</var>.
170
 
</dl>
171
 
 
172
 
<P>
173
 
<dl><dt><b><a name='l2h-54'><tt class='method'>set_serial_number</tt></a></b>(<var>serialno</var>)
174
 
<dd>
175
 
Set the serial number of the certificate to <var>serialno</var>.
176
 
</dl>
177
 
 
178
 
<P>
179
 
<dl><dt><b><a name='l2h-55'><tt class='method'>set_subject</tt></a></b>(<var>subject</var>)
180
 
<dd>
181
 
Set the subject of the certificate to <var>subject</var>.
182
 
</dl>
183
 
 
184
 
<P>
185
 
<dl><dt><b><a name='l2h-56'><tt class='method'>set_version</tt></a></b>(<var>version</var>)
186
 
<dd>
187
 
Set the certificate version to <var>version</var>.
188
 
</dl>
189
 
 
190
 
<P>
191
 
<dl><dt><b><a name='l2h-57'><tt class='method'>sign</tt></a></b>(<var>pkey, digest</var>)
192
 
<dd>
193
 
Sign the certificate, using the key <var>pkey</var> and the message digest algorithm
194
 
identified by the string <var>digest</var>.
195
 
</dl>
196
 
 
197
 
<P>
198
 
<dl><dt><b><a name='l2h-58'><tt class='method'>subject_name_hash</tt></a></b>()
199
 
<dd>
200
 
Return the hash of the certificate subject.
201
 
</dl>
202
 
 
203
 
<P>
204
 
<dl><dt><b><a name='l2h-59'><tt class='method'>digest</tt></a></b>(<var>digest_name</var>)
205
 
<dd>
206
 
Return a digest of the certificate, using the <var>digest_name</var> method.
207
 
<var>digest_name</var> must be a string describing a digest algorithm supported
208
 
by OpenSSL (by EVP_get_digestbyname, specifically).  For example,
209
 
<tt class="constant">"md5"</tt> or <tt class="constant">"sha1"</tt>.
210
 
</dl>
211
 
 
212
 
<P>
213
 
<dl><dt><b><a name='l2h-60'><tt class='method'>add_extensions</tt></a></b>(<var>extensions</var>)
214
 
<dd>
215
 
Add the extensions in the sequence <var>extensions</var> to the certificate.
216
 
</dl>
217
 
 
218
 
<P>
219
 
<dl><dt><b><a name='l2h-61'><tt class='method'>get_extension_count</tt></a></b>()
220
 
<dd>
221
 
Return the number of extensions on this certificate.
222
 
 
223
 
<span class='versionnote'>New in version 0.12.</span>
224
 
 
225
 
</dl>
226
 
 
227
 
<P>
228
 
<dl><dt><b><a name='l2h-62'><tt class='method'>get_extension</tt></a></b>(<var>index</var>)
229
 
<dd>
230
 
Retrieve the extension on this certificate at the given index.
231
 
 
232
 
<P>
233
 
Extensions on a certificate are kept in order.  The index parameter selects
234
 
which extension will be returned.  The returned object will be an X509Extension
235
 
instance.
236
 
 
237
 
<span class='versionnote'>New in version 0.12.</span>
238
 
 
239
 
</dl>
240
 
 
241
 
<P>
242
 
 
243
 
<DIV CLASS="navigation">
244
 
<p><hr>
245
 
<table align="center" width="100%" cellpadding="0" cellspacing="2">
246
 
<tr>
247
 
<td><A href="openssl-crypto.html"><img src="previous.gif"
248
 
  border="0" height="32"
249
 
  alt="Previous Page" width="32"></A></td>
250
 
<td><A href="openssl-crypto.html"><img src="up.gif"
251
 
  border="0" height="32"
252
 
  alt="Up One Level" width="32"></A></td>
253
 
<td><A href="openssl-x509name.html"><img src="next.gif"
254
 
  border="0" height="32"
255
 
  alt="Next Page" width="32"></A></td>
256
 
<td align="center" width="100%">Python OpenSSL Manual</td>
257
 
<td><A href="contents.html"><img src="contents.gif"
258
 
  border="0" height="32"
259
 
  alt="Contents" width="32"></A></td>
260
 
<td><img src="blank.gif"
261
 
  border="0" height="32"
262
 
  alt="" width="32"></td>
263
 
<td><img src="blank.gif"
264
 
  border="0" height="32"
265
 
  alt="" width="32"></td>
266
 
</tr></table>
267
 
<b class="navlabel">Previous:</b> <a class="sectref" href="openssl-crypto.html">3.1 crypto  </A>
268
 
<b class="navlabel">Up:</b> <a class="sectref" href="openssl-crypto.html">3.1 crypto  </A>
269
 
<b class="navlabel">Next:</b> <a class="sectref" href="openssl-x509name.html">3.1.2 X509Name objects</A>
270
 
<hr>
271
 
<span class="release-info">Release 0.13.</span>
272
 
</DIV>
273
 
<!--End of Navigation Panel-->
274
 
 
275
 
</BODY>
276
 
</HTML>