diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2018-10-02 07:54:31 +0800 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2018-10-01 19:54:31 -0400 |
commit | a07de31096767abd3b4529ae29c0487c8f21310b (patch) | |
tree | 28eb5577ebb97209332c50b17c92e29e981ac644 /docs/x509 | |
parent | 1717f8c998b22fbbebec4b5514aee42fb3a2f68d (diff) | |
download | cryptography-a07de31096767abd3b4529ae29c0487c8f21310b.tar.gz cryptography-a07de31096767abd3b4529ae29c0487c8f21310b.tar.bz2 cryptography-a07de31096767abd3b4529ae29c0487c8f21310b.zip |
support OCSP response parsing (#4452)
* support OCSP response parsing
* move the decorator to make pep8 happy
* add some missing docs
* review feedback
* more review feedback
Diffstat (limited to 'docs/x509')
-rw-r--r-- | docs/x509/ocsp.rst | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/x509/ocsp.rst b/docs/x509/ocsp.rst index 14d9bb84..b2030226 100644 --- a/docs/x509/ocsp.rst +++ b/docs/x509/ocsp.rst @@ -74,6 +74,7 @@ OCSP b",\xdez\t\xbe1\x1bC\xbc\x1c*MSX\x02\x15\x00\x98\xd9\xe5\xc0\xb4\xc3" b"sU-\xf7|]\x0f\x1e\xb5\x12\x8eIE\xf9" ) + der_ocsp_resp_unauth = b"0\x03\n\x01\x06" OCSP (Online Certificate Status Protocol) is a method of checking the revocation status of certificates. It is specified in :rfc:`6960`, as well @@ -151,6 +152,26 @@ Creating Requests >>> base64.b64encode(req.public_bytes(serialization.Encoding.DER)) b'MEMwQTA/MD0wOzAJBgUrDgMCGgUABBRAC0Z68eay0wmDug1gfn5ZN0gkxAQUw5zz/NNGCDS7zkZ/oHxb8+IIy1kCAj8g' +Loading Responses +~~~~~~~~~~~~~~~~~ + +.. function:: load_der_ocsp_response(data) + + .. versionadded:: 2.4 + + Deserialize an OCSP response from DER encoded data. + + :param bytes data: The DER encoded OCSP response data. + + :returns: An instance of :class:`~cryptography.x509.ocsp.OCSPResponse`. + + .. doctest:: + + >>> from cryptography.x509 import ocsp + >>> ocsp_resp = ocsp.load_der_ocsp_response(der_ocsp_resp_unauth) + >>> print(ocsp_resp.response_status) + OCSPResponseStatus.UNAUTHORIZED + Interfaces ~~~~~~~~~~ |