diff options
author | Dan Mahr <danmahr23@gmail.com> | 2022-02-14 22:40:36 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-15 09:40:36 +0600 |
commit | 827d4425dbd2e6f9b521e514ced889cfb3aada21 (patch) | |
tree | 10950acac710b1f1419cb9798e96726ab7b6fc39 | |
parent | b4c579785803374cd5c08046c927d713c7324b78 (diff) | |
download | pyjwt-827d4425dbd2e6f9b521e514ced889cfb3aada21.tar.gz |
Docs: mention performance reasons for reusing RSAPrivateKey when encoding (#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>
-rw-r--r-- | docs/usage.rst | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/docs/usage.rst b/docs/usage.rst index e40c679..9d541d5 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -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 ----------------------------- |