aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Stapleton <alexs@prol.etari.at>2014-05-16 21:06:40 +0100
committerAlex Stapleton <alexs@prol.etari.at>2014-05-16 21:06:40 +0100
commit307b6cbe1fb712e36307d615668ebd18b1e3739c (patch)
tree2c19900aa86ab6f08784a1af25ab263464dd6c3d
parent595393dd4d84f1bbb6541082b837c6cfb1aaa71b (diff)
downloadcryptography-307b6cbe1fb712e36307d615668ebd18b1e3739c.tar.gz
cryptography-307b6cbe1fb712e36307d615668ebd18b1e3739c.tar.bz2
cryptography-307b6cbe1fb712e36307d615668ebd18b1e3739c.zip
Updated docstrings
-rw-r--r--cryptography/hazmat/backends/openssl/backend.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/cryptography/hazmat/backends/openssl/backend.py b/cryptography/hazmat/backends/openssl/backend.py
index 5a434dcd..c8a93ef6 100644
--- a/cryptography/hazmat/backends/openssl/backend.py
+++ b/cryptography/hazmat/backends/openssl/backend.py
@@ -389,6 +389,11 @@ class Backend(object):
return _MemoryBIO(self._ffi.gc(bio, self._lib.BIO_free), data_char_p)
def _evp_pkey_to_private_key(self, evp_pkey):
+ """
+ Return the appropriate type of PrivateKey given an evp_pkey cdata
+ pointer.
+ """
+
type = evp_pkey.type
if type == self._lib.EVP_PKEY_RSA:
@@ -427,12 +432,15 @@ class Backend(object):
def _pem_password_cb(self, password):
"""
- Generate a pem_password_cb that returns password
+ Generate a pem_password_cb function pointer that copied the password to
+ OpenSSL as required and returns the number of bytes copied.
typedef int pem_password_cb(char *buf, int size,
int rwflag, void *userdata);
- suitable for decrypting PKCS8 files and so on
+ Useful for decrypting PKCS8 files and so on.
+
+ Returns a tuple of (cdata function pointer, callback function).
"""
def pem_password_cb(buf, size, writing, userdata):