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