summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/OpenSSL/crypto.py18
-rw-r--r--tests/test_crypto.py4
2 files changed, 12 insertions, 10 deletions
diff --git a/src/OpenSSL/crypto.py b/src/OpenSSL/crypto.py
index 58e176d..dba0310 100644
--- a/src/OpenSSL/crypto.py
+++ b/src/OpenSSL/crypto.py
@@ -1625,12 +1625,13 @@ def dump_certificate(type, cert):
def dump_publickey(type, pkey):
"""
- Dump a public key to a buffer
+ Dump a public key to a buffer.
- :param type: The file type (one of FILETYPE_PEM or FILETYPE_ASN1).
- :param pkey: The PKey to dump.
+ :param type: The file type (one of :py:data:`FILETYPE_PEM` or
+ :py:data:`FILETYPE_ASN1`).
+ :param pkey: The :py:class:`PKey` to dump.
:return: The buffer with the dumped key in it.
- :rtype: :py:data:`bytes`
+ :rtype: bytes
"""
bio = _new_mem_buf()
if type == FILETYPE_PEM:
@@ -2431,11 +2432,12 @@ class _PassphraseHelper(object):
def load_publickey(type, buffer):
"""
- Load a public key from a buffer
+ Load a public key from a buffer.
- :param type: The file type (one of FILETYPE_PEM, FILETYPE_ASN1)
- :param buffer: The buffer the key is stored in
- :return: The PKey object
+ :param type: The file type (one of :py:data:`FILETYPE_PEM`,
+ :py:data:`FILETYPE_ASN1`).
+ :param buffer: The buffer the key is stored in.
+ :return: The :py:class:`PKey` object.
"""
if isinstance(buffer, _text_type):
buffer = buffer.encode("ascii")
diff --git a/tests/test_crypto.py b/tests/test_crypto.py
index a3c540e..ad6df1d 100644
--- a/tests/test_crypto.py
+++ b/tests/test_crypto.py
@@ -2577,7 +2577,7 @@ class FunctionTests(TestCase):
def test_dump_publickey_pem(self):
"""
- :py:obj:`dump_publickey` writes a PEM
+ dump_publickey writes a PEM.
"""
key = load_publickey(FILETYPE_PEM, cleartextPublicKeyPEM)
dumped_pem = dump_publickey(FILETYPE_PEM, key)
@@ -2585,7 +2585,7 @@ class FunctionTests(TestCase):
def test_dump_publickey_asn1(self):
"""
- :py:obj:`dump_publickey` writes a DER
+ dump_publickey writes a DER.
"""
key = load_publickey(FILETYPE_PEM, cleartextPublicKeyPEM)
dumped_der = dump_publickey(FILETYPE_ASN1, key)