diff options
| author | Laurens Van Houtven <_@lvh.cc> | 2014-06-19 17:08:41 +0200 |
|---|---|---|
| committer | Laurens Van Houtven <_@lvh.cc> | 2014-06-19 17:08:41 +0200 |
| commit | d92f55c93beefa489a07b8b1db35be27210edc2a (patch) | |
| tree | 171254a6736745d180b616648c629ba69a622df2 /OpenSSL | |
| parent | 59152b5767eceefd508e5b3886431d0607de3ad0 (diff) | |
| download | pyopenssl-d92f55c93beefa489a07b8b1db35be27210edc2a.tar.gz | |
Use autodoc for Revoked
Diffstat (limited to 'OpenSSL')
| -rw-r--r-- | OpenSSL/crypto.py | 62 |
1 files changed, 41 insertions, 21 deletions
diff --git a/OpenSSL/crypto.py b/OpenSSL/crypto.py index 99b9691..90c57a7 100644 --- a/OpenSSL/crypto.py +++ b/OpenSSL/crypto.py @@ -1632,6 +1632,9 @@ def _X509_REVOKED_dup(original): class Revoked(object): + """ + A certificate revocation. + """ # http://www.openssl.org/docs/apps/x509v3_config.html#CRL_distribution_points_ # which differs from crl_reasons of crypto/x509v3/v3_enum.c that matches # OCSP_crl_reason_str. We use the latter, just like the command line @@ -1654,10 +1657,14 @@ class Revoked(object): def set_serial(self, hex_str): """ - Set the serial number of a revoked Revoked structure + Set the serial number. + + The serial number is formatted as a hexadecimal number encoded in + ASCII. :param hex_str: The new serial number. - :type hex_str: :py:data:`str` + :type hex_str: :py:class:`bytes` + :return: :py:const:`None` """ bignum_serial = _ffi.gc(_lib.BN_new(), _lib.BN_free) @@ -1675,9 +1682,13 @@ class Revoked(object): def get_serial(self): """ - Return the serial number of a Revoked structure + Get the serial number. + + The serial number is formatted as a hexadecimal number encoded in + ASCII. - :return: The serial number as a string + :return: The serial number. + :rtype: :py:class:`bytes` """ bio = _new_mem_buf() @@ -1701,13 +1712,19 @@ class Revoked(object): def set_reason(self, reason): """ - Set the reason of a Revoked object. + Set the reason of this revocation. If :py:data:`reason` is :py:const:`None`, delete the reason instead. :param reason: The reason string. - :type reason: :py:class:`str` or :py:class:`NoneType` + :type reason: :py:class:`bytes` or :py:class:`NoneType` + :return: :py:const:`None` + + .. seealso:: + + :py:meth:`all_reasons`, which gives you a list of all supported + reasons which you might pass to this method. """ if reason is None: self._delete_reason() @@ -1739,9 +1756,15 @@ class Revoked(object): def get_reason(self): """ - Return the reason of a Revoked object. + Set the reason of this revocation. + + :return: The reason, or :py:const:`None` if there is none. + :rtype: :py:class:`bytes` or :py:class:`NoneType` + + .. seealso:: - :return: The reason as a string + :py:meth:`all_reasons`, which gives you a list of all supported + reasons this method might return. """ extensions = self._revoked.extensions for i in range(_lib.sk_X509_EXTENSION_num(extensions)): @@ -1763,21 +1786,21 @@ class Revoked(object): """ Return a list of all the supported reason strings. + This list is a copy; modifying it does not change the supported reason + strings. + :return: A list of reason strings. + :rtype: :py:class:`list` of :py:class:`bytes` """ return self._crl_reasons[:] def set_rev_date(self, when): """ - Set the revocation timestamp - - :param when: A string giving the timestamp, in the format: - - YYYYMMDDhhmmssZ - YYYYMMDDhhmmss+hhmm - YYYYMMDDhhmmss-hhmm + Set the revocation timestamp. + :param when: The timestamp of the revocation, as ASN.1 GENERALIZEDTIME. + :type when: :py:class:`bytes` :return: :py:const:`None` """ return _set_asn1_time(self._revoked.revocationDate, when) @@ -1785,13 +1808,10 @@ class Revoked(object): def get_rev_date(self): """ - Retrieve the revocation date + Get the revocation timestamp. - :return: A string giving the timestamp, in the format: - - YYYYMMDDhhmmssZ - YYYYMMDDhhmmss+hhmm - YYYYMMDDhhmmss-hhmm + :return: The timestamp of the revocation, as ASN.1 GENERALIZEDTIME. + :rtype: :py:class:`bytes` """ return _get_asn1_time(self._revoked.revocationDate) |
