summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAjitomi, Daisuke <ajitomi@gmail.com>2021-04-17 02:00:06 +0900
committerGitHub <noreply@github.com>2021-04-16 13:00:06 -0400
commitfb86f9dffb371ee2adbc573edc35ded129ea3b36 (patch)
tree19455dc0b58583c0e3e8f952021f2e049ffef648 /tests
parentbcd572806c121c2f85d104b3e13a196e5bb46a79 (diff)
downloadpyjwt-fb86f9dffb371ee2adbc573edc35ded129ea3b36.tar.gz
Allow to verify with private key on ECAlgorithm, as well as on Ed25519Algorithm. (#645)
* Add private key support for ECAlgorithm verify. * Update CHANGELOG.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_algorithms.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_algorithms.py b/tests/test_algorithms.py
index 2144d48..982a145 100644
--- a/tests/test_algorithms.py
+++ b/tests/test_algorithms.py
@@ -658,6 +658,13 @@ class TestAlgorithmsRFC7520:
result = algo.verify(signing_input, key, signature)
assert result
+ # private key can also be used.
+ with open(key_path("jwk_ec_key_P-521.json")) as keyfile:
+ private_key = algo.from_jwk(keyfile.read())
+
+ result = algo.verify(signing_input, private_key, signature)
+ assert result
+
@crypto_required
class TestEd25519Algorithms: