Skip to content

Commit 98fc909

Browse files
authored
Merge pull request #130 from mattsb42-aws/readme-updates
Updating readme descriptions of crypto backends
2 parents 29e14dc + 6448d7a commit 98fc909

File tree

1 file changed

+47
-22
lines changed

1 file changed

+47
-22
lines changed

README.rst

Lines changed: 47 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,44 +21,64 @@ Installation
2121

2222
::
2323

24-
$ pip install python-jose
24+
$ pip install python-jose[cryptography]
2525

2626

27-
Custom Backends
28-
---------------
27+
Cryptographic Backends
28+
----------------------
2929

30-
As of 3.0.0, python-jose uses the pure-python rsa module by default for RSA signing and verification. If
31-
necessary, other RSA backends are supported. Options include crytography, pycryptodome, and pycrypto.
30+
As of 3.1.0, python-jose implements four different cryptographic backends.
31+
The backend must be selected as an extra when installing python-jose.
32+
If you do not select a backend, the native-python backend will be installed.
3233

33-
In order to use a custom backend, install python-jose with the appropriate extra.
34+
Unless otherwise noted, all backends support all operations.
3435

35-
It is recommended that a custom backend is used in production, as the pure-python rsa module is slow.
36+
Due to complexities with setuptools, the native-python backend is always installed,
37+
even if you select a different backend on install.
38+
We recommend that you remove unnecessary dependencies in production.
3639

37-
The crytography option is a good default.
40+
#. cryptography
3841

39-
::
42+
* This backend uses `pyca/cryptography`_ for all cryptographic operations.
43+
This is the recommended backend and is selected over all other backends if any others are present.
44+
* Installation: ``pip install python-jose[cryptography]``
45+
* Unused dependencies:
4046

41-
$ pip install python-jose[cryptography]
42-
$ pip install python-jose[pycryptodome]
43-
$ pip install python-jose[pycrypto]
47+
* ``rsa``
48+
* ``ecdsa``
49+
* ``pyasn1``
50+
51+
#. pycryptodome
52+
53+
* This backend uses `pycryptodome`_ for all cryptographic operations.
54+
* Installation: ``pip install python-jose[pycryptodome]``
55+
* Unused dependencies:
56+
57+
* ``rsa``
58+
59+
#. native-python
4460

45-
Due to complexities with setuptools, the ``python-rsa`` and ``python-ecdsa`` libraries are always installed.
46-
If you use one of the custom backends and would like to clean up unneeded dependencies,
47-
you can remove the following dependencies for each backend:
61+
* This backend uses `python-rsa`_ and `python-ecdsa`_ for all cryptographic operations.
62+
This backend is always installed but any other backend will take precedence if one is installed.
63+
* Installation: ``pip install python-jose``
4864

49-
* ``cryptography``
65+
.. note::
5066

51-
* ``pip uninstall rsa ecdsa pyasn1``
67+
The native-python backend cannot process certificates.
5268

53-
* ``pycrypto`` or ``pycryptodome``
69+
#. pycrypto
5470

55-
* ``pip uninstall rsa``
71+
* This backend uses `pycrypto`_ for all cryptographic operations.
72+
* Installation: ``pip install python-jose[pycrypto]``
73+
* Unused dependencies:
5674

57-
.. warning::
75+
* ``rsa``
5876

59-
Uninstall carefully. Make sure that nothing else in your environment needs these
60-
libraries before uninstalling them.
77+
.. warning::
6178

79+
The `pycrypto`_ project has not been maintained since 2013.
80+
This backend is maintained for legacy compatibility purposes only.
81+
Do not use this backend unless you cannot use any of the others.
6282

6383
Usage
6484
-----
@@ -86,3 +106,8 @@ This library was originally based heavily on the work of the folks over at PyJWT
86106
:target: https://python-jose.readthedocs.org/en/latest/
87107
.. _ReadTheDocs: https://python-jose.readthedocs.org/en/latest/
88108
.. _PyJWT: https://github.com/jpadilla/pyjwt
109+
.. _pyca/cryptography: http://cryptography.io/
110+
.. _pycryptodome: https://pycryptodome.readthedocs.io/en/latest/
111+
.. _pycrypto: https://www.dlitz.net/software/pycrypto/
112+
.. _python-ecdsa: https://github.com/warner/python-ecdsa
113+
.. _python-rsa: https://stuvel.eu/rsa

0 commit comments

Comments
 (0)