Skip to content
This repository was archived by the owner on Apr 20, 2025. It is now read-only.

Commit ce5a32f

Browse files
committed
Fix #199: Sphinx warnings reference target not found
Fix the documentation by adding referenced-but-not-included functions and some other small fixes. The only warnings left are: ``` python-rsa/rsa/key.py:docstring of rsa.key.AbstractKey.load_pkcs1:: WARNING: py:class reference target not found: rsa.key.T python-rsa/rsa/key.py:docstring of rsa.key.AbstractKey.load_pkcs1:: WARNING: py:class reference target not found: rsa.key.T ``` These are due to Sphynx not really understanding `typing` type references. Not sure how to fix those.
1 parent 0e3e548 commit ce5a32f

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

doc/reference.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ Functions
1717

1818
.. autofunction:: rsa.find_signature_hash
1919

20-
.. autofunction:: rsa.newkeys(keysize)
20+
.. autofunction:: rsa.newkeys
21+
22+
.. autofunction:: rsa.sign_hash
23+
24+
.. autofunction:: rsa.compute_hash
25+
26+
.. autodata:: rsa.pkcs1.HASH_METHODS
2127

2228

2329
Classes
@@ -31,6 +37,8 @@ Classes
3137
constructed data. Never unpickle data received from an untrusted
3238
or unauthenticated source.
3339

40+
.. autoclass:: rsa.key.AbstractKey
41+
3442
.. autoclass:: rsa.PublicKey
3543
:members:
3644
:inherited-members:

doc/usage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ Modify the message, and the signature is no longer valid and a
214214
makes cracking the keys easier.
215215

216216
Instead of a message you can also call :py:func:`rsa.sign` and
217-
:py:func:`rsa.verify` with a :py:class:`file`-like object. If the
217+
:py:func:`rsa.verify` with a `file`-like object. If the
218218
message object has a ``read(int)`` method it is assumed to be a file.
219219
In that case the file is hashed in 1024-byte blocks at the time.
220220

rsa/pkcs1.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"SHA-384": hashlib.sha384,
5858
"SHA-512": hashlib.sha512,
5959
}
60+
"""Hash methods supported by this library."""
6061

6162

6263
if sys.version_info >= (3, 6):
@@ -423,7 +424,7 @@ def compute_hash(message: typing.Union[bytes, typing.BinaryIO], method_name: str
423424
object. If ``message`` has a ``read()`` method, it is assumed to be a
424425
file-like object.
425426
:param method_name: the hash method, must be a key of
426-
:py:const:`HASH_METHODS`.
427+
:py:const:`rsa.pkcs1.HASH_METHODS`.
427428
428429
"""
429430

0 commit comments

Comments
 (0)