Skip to content

Add support for brainpool curves #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[tool.poetry]
name = "cryptojwt"
version = "1.9.4"
version = "1.10.0"
description = "Python implementation of JWT, JWE, JWS and JWK"
authors = ["Roland Hedberg <[email protected]>"]
license = "Apache-2.0"
Expand Down
3 changes: 3 additions & 0 deletions src/cryptojwt/jwk/ec.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
"P-224": ec.SECP224R1,
"P-192": ec.SECP192R1,
"P-256K": ec.SECP256K1,
"brainpoolp256r1": ec.BrainpoolP256R1,
"brainpoolp384r1": ec.BrainpoolP384R1,
"brainpoolp512r1": ec.BrainpoolP512R1,
}

# Inverted NIST2SEC dictionary
Expand Down
6 changes: 6 additions & 0 deletions tests/test_02_jwk.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ def test_create_eckey():
assert _eq(list(exp_key.keys()), ["y", "x", "crv", "kty", "kid"])


def test_create_eckey_brainpoolp256r1():
ec = new_ec_key("brainpoolp256r1")
exp_key = ec.serialize()
assert _eq(list(exp_key.keys()), ["y", "x", "crv", "kty", "kid"])


def test_cmp_neq_ec():
ec_key = new_ec_key("P-256")
_key1 = ECKey(priv_key=ec_key.priv_key)
Expand Down