Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 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"> </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-34'><tt class='method'>get_issuer</tt></a></b>() |
| 56 | <dd> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame^] | 57 | Return an X509Name object representing the issuer of the certificate. |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 58 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame^] | 59 | |
| 60 | <P> |
| 61 | <dl><dt><b><a name='l2h-35'><tt class='method'>get_pubkey</tt></a></b>() |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 62 | <dd> |
| 63 | Return a PKey object representing the public key of the certificate. |
| 64 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame^] | 65 | |
| 66 | <P> |
| 67 | <dl><dt><b><a name='l2h-36'><tt class='method'>get_serial_number</tt></a></b>() |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 68 | <dd> |
| 69 | Return the certificate serial number. |
| 70 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame^] | 71 | |
| 72 | <P> |
| 73 | <dl><dt><b><a name='l2h-37'><tt class='method'>get_subject</tt></a></b>() |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 74 | <dd> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame^] | 75 | Return an X509Name object representing the subject of the certificate. |
| 76 | </dl> |
| 77 | |
| 78 | <P> |
| 79 | <dl><dt><b><a name='l2h-38'><tt class='method'>get_version</tt></a></b>() |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 80 | <dd> |
| 81 | Return the certificate version. |
| 82 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame^] | 83 | |
| 84 | <P> |
| 85 | <dl><dt><b><a name='l2h-39'><tt class='method'>gmtime_adj_notBefore</tt></a></b>(<var>time</var>) |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 86 | <dd> |
| 87 | Adjust the timestamp (in GMT) when the certificate starts being valid. |
| 88 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame^] | 89 | |
| 90 | <P> |
| 91 | <dl><dt><b><a name='l2h-40'><tt class='method'>gmtime_adj_notAfter</tt></a></b>(<var>time</var>) |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 92 | <dd> |
| 93 | Adjust the timestamp (in GMT) when the certificate stops being valid. |
| 94 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame^] | 95 | |
| 96 | <P> |
| 97 | <dl><dt><b><a name='l2h-41'><tt class='method'>has_expired</tt></a></b>() |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 98 | <dd> |
| 99 | Checks the certificate's time stamp against current time. Returns true if the |
| 100 | certificate has expired and false otherwise. |
| 101 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame^] | 102 | |
| 103 | <P> |
| 104 | <dl><dt><b><a name='l2h-42'><tt class='method'>set_issuer</tt></a></b>(<var>issuer</var>) |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 105 | <dd> |
| 106 | Set the issuer of the certificate to <var>issuer</var>. |
| 107 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame^] | 108 | |
| 109 | <P> |
| 110 | <dl><dt><b><a name='l2h-43'><tt class='method'>set_pubkey</tt></a></b>(<var>pkey</var>) |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 111 | <dd> |
| 112 | Set the public key of the certificate to <var>pkey</var>. |
| 113 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame^] | 114 | |
| 115 | <P> |
| 116 | <dl><dt><b><a name='l2h-44'><tt class='method'>set_serial_number</tt></a></b>(<var>serialno</var>) |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 117 | <dd> |
| 118 | Set the serial number of the certificate to <var>serialno</var>. |
| 119 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame^] | 120 | |
| 121 | <P> |
| 122 | <dl><dt><b><a name='l2h-45'><tt class='method'>set_subject</tt></a></b>(<var>subject</var>) |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 123 | <dd> |
| 124 | Set the subject of the certificate to <var>subject</var>. |
| 125 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame^] | 126 | |
| 127 | <P> |
| 128 | <dl><dt><b><a name='l2h-46'><tt class='method'>set_version</tt></a></b>(<var>version</var>) |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 129 | <dd> |
| 130 | Set the certificate version to <var>version</var>. |
| 131 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame^] | 132 | |
| 133 | <P> |
| 134 | <dl><dt><b><a name='l2h-47'><tt class='method'>sign</tt></a></b>(<var>pkey, digest</var>) |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 135 | <dd> |
| 136 | Sign the certificate, using the key <var>pkey</var> and the message digest algorithm |
| 137 | identified by the string <var>digest</var>. |
| 138 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame^] | 139 | |
| 140 | <P> |
| 141 | <dl><dt><b><a name='l2h-48'><tt class='method'>subject_name_hash</tt></a></b>() |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 142 | <dd> |
| 143 | Return the hash of the certificate subject. |
| 144 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame^] | 145 | |
| 146 | <P> |
| 147 | <dl><dt><b><a name='l2h-49'><tt class='method'>digest</tt></a></b>(<var>digest_name</var>) |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 148 | <dd> |
| 149 | Return a digest of the certificate, using the <var>digest_name</var> method. |
| 150 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame^] | 151 | |
| 152 | <P> |
| 153 | <dl><dt><b><a name='l2h-50'><tt class='method'>add_extensions</tt></a></b>(<var>extensions</var>) |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 154 | <dd> |
| 155 | Add the extensions in the sequence <var>extensions</var> to the certificate. |
| 156 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame^] | 157 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 158 | <P> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame^] | 159 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 160 | <DIV CLASS="navigation"> |
| 161 | <p><hr> |
| 162 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 163 | <tr> |
| 164 | <td><A href="openssl-crypto.html"><img src="previous.gif" |
| 165 | border="0" height="32" |
| 166 | alt="Previous Page" width="32"></A></td> |
| 167 | <td><A href="openssl-crypto.html"><img src="up.gif" |
| 168 | border="0" height="32" |
| 169 | alt="Up One Level" width="32"></A></td> |
| 170 | <td><A href="openssl-x509name.html"><img src="next.gif" |
| 171 | border="0" height="32" |
| 172 | alt="Next Page" width="32"></A></td> |
| 173 | <td align="center" width="100%">Python OpenSSL Manual</td> |
| 174 | <td><A href="contents.html"><img src="contents.gif" |
| 175 | border="0" height="32" |
| 176 | alt="Contents" width="32"></A></td> |
| 177 | <td><img src="blank.gif" |
| 178 | border="0" height="32" |
| 179 | alt="" width="32"></td> |
| 180 | <td><img src="blank.gif" |
| 181 | border="0" height="32" |
| 182 | alt="" width="32"></td> |
| 183 | </tr></table> |
| 184 | <b class="navlabel">Previous:</b> <a class="sectref" href="openssl-crypto.html">3.1 crypto </A> |
| 185 | <b class="navlabel">Up:</b> <a class="sectref" href="openssl-crypto.html">3.1 crypto </A> |
| 186 | <b class="navlabel">Next:</b> <a class="sectref" href="openssl-x509name.html">3.1.2 X509Name objects</A> |
| 187 | <hr> |
| 188 | <span class="release-info">Release 0.6.</span> |
| 189 | </DIV> |
| 190 | <!--End of Navigation Panel--> |
| 191 | |
| 192 | </BODY> |
| 193 | </HTML> |