micropython-lib
micropython-lib copied to clipboard
pyjwt: ES256 algorithm support for PyJWT.
Add optional support for ES256 JWT signing/verifying to PyJWT using @dmazzella's cryptography port.
Test output:
Testing HS256
Encode/decode test: OK
Invalid signature test: OK
Expired token test: OK
Testing ES256
Encode/decode ES256 test: OK
Invalid signature test: OK
Thanks for the contribution!
This isn't a full review, but some initial questions/feedback:
- Is this ES256 support compatible with the CPython PyJWT library?
- MicroPython tries to be minimal where possible, so I suggest inlining
_sig_jws_to_derand_sig_der_to_jwsat their place of use (they are only used once). That will save a bit of code size. - Also maybe the error message about required dependencies can be a little shorter/terser, to save size.
- Can you please put the new test into a separate test for ES256, so that the tests can be run independently, and the original one still pass without
cryptographyinstalled. - Would be great to also add the tests to CI, see
tools/ci.sh.