summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Paul Calderone <exarkun@twistedmatrix.com>2015-01-18 15:37:10 -0500
committerStephen Holsapple <sholsapp@gmail.com>2015-01-30 17:49:38 -0800
commitb7b7fb9b223a039bef4013a60292cf4b6e583049 (patch)
treee650ac588b7e420f154a5ba20b24ae25c1e578d0
parent282d3c81ce78d05540bf18cfce105581ed890350 (diff)
downloadpyopenssl-b7b7fb9b223a039bef4013a60292cf4b6e583049.tar.gz
Whitespace and X509StoreContext documentation cleanups.
-rw-r--r--OpenSSL/crypto.py23
1 files changed, 18 insertions, 5 deletions
diff --git a/OpenSSL/crypto.py b/OpenSSL/crypto.py
index 5a46983..fbccb6d 100644
--- a/OpenSSL/crypto.py
+++ b/OpenSSL/crypto.py
@@ -1397,16 +1397,27 @@ class X509StoreContext(object):
encapsulated in this object includes, but is not limited to, a set of
trusted certificates, verification parameters and revoked certificates.
- :param store: An :py:class:`X509Store` of trusted certificates.
- :param cert: An :py:class:`X509` certificate to be validated during a
- subsequent call to :py:func:`verify_cert`.
+ :ivar _store_ctx: The underlying X509_STORE_CTX structure used by this
+ instance. It is dynamically allocated and automatically garbage
+ collected.
+
+ :ivar _store: See the ``store`` `__init__`` parameter.
+
+ :ivar _cert: See the ``certificate`` `__init__`` parameter.
"""
- def __init__(self, store, cert):
+ def __init__(self, store, certificate):
+ """
+ :param X509Store store: The certificates which will be trusted for the
+ purposes of any verifications.
+
+ :param X509 certificate: The certificate to be verified.
+ """
store_ctx = _lib.X509_STORE_CTX_new()
self._store_ctx = _ffi.gc(store_ctx, _lib.X509_STORE_CTX_free)
self._store = store
- self._cert = cert
+ self._cert = certificate
+
def _init(self):
"""
@@ -1416,6 +1427,7 @@ class X509StoreContext(object):
if ret <= 0:
_raise_current_error()
+
def _cleanup(self):
"""
Internally cleans up the store context.
@@ -1426,6 +1438,7 @@ class X509StoreContext(object):
_lib.X509_STORE_CTX_cleanup(self._store_ctx)
+
def load_certificate(type, buffer):
"""
Load a certificate from a buffer