Skip to content

Commit

Permalink
Docs: mention performance reasons for reusing RSAPrivateKey when enco…
Browse files Browse the repository at this point in the history
…ding (#734)

* Mention reusing RSAPrivateKey for performance reasons

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
dmahr1 and pre-commit-ci[bot] committed Feb 15, 2022
1 parent b4c5797 commit 827d442
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/usage.rst
Expand Up @@ -45,6 +45,9 @@ If your private key needs a passphrase, you need to pass in a ``PrivateKey`` obj
)
encoded = jwt.encode({"some": "payload"}, private_key, algorithm="RS256")
If you are repeatedly encoding with the same private key, reusing the same
``RSAPrivateKey`` also has performance benefits because it avoids the
CPU-intensive ``RSA_check_key`` primality test.

Specifying Additional Headers
-----------------------------
Expand Down

0 comments on commit 827d442

Please sign in to comment.