Skip to content

Commit 818eb0c

Browse files
committed
add some P-256K/ES256K tests
1 parent 1671134 commit 818eb0c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

tests/test_06_jws.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,12 @@ def test_jws_mm():
511511

512512
@pytest.mark.parametrize(
513513
"ec_func,alg",
514-
[(ec.SECP256R1, "ES256"), (ec.SECP384R1, "ES384"), (ec.SECP521R1, "ES512")],
514+
[
515+
(ec.SECP256R1, "ES256"),
516+
(ec.SECP384R1, "ES384"),
517+
(ec.SECP521R1, "ES512"),
518+
(ec.SECP256K1, "ES256K"),
519+
],
515520
)
516521
def test_signer_es(ec_func, alg):
517522
payload = "Please take a moment to register today"

tests/test_09_jwt.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ def test_msg_cls():
212212
{"type": "RSA", "use": ["sig"]},
213213
{"type": "RSA", "use": ["enc"]},
214214
{"type": "EC", "crv": "P-256", "use": ["sig"]},
215+
{"type": "EC", "crv": "P-256K", "use": ["sig"]},
215216
{"type": "EC", "crv": "P-384", "use": ["sig"]},
216217
]
217218

@@ -230,6 +231,9 @@ def test_pick_key():
230231
_k = pick_key(keys, "sig", "ES384")
231232
assert len(_k) == 1
232233

234+
_k = pick_key(keys, "sig", "ES256K")
235+
assert len(_k) == 1
236+
233237
_k = pick_key(keys, "enc", "RSA-OAEP-256")
234238
assert len(_k) == 1
235239

0 commit comments

Comments
 (0)