openbullet / OpenBullet2

OpenBullet reinvented
https://docs.openbullet.dev/
MIT License
1.8k stars 480 forks source link

Add elliptic curve support for JWT signature #1059

Closed GekySan closed 4 months ago

GekySan commented 4 months ago

Description

This pull request implements EC signing support for JWT encoding. The JwtEncode method has been modified to include support for ES256, ES384 and ES512 algorithms.

Type of change

How Has This Been Tested?

string privateKey = @"-----BEGIN EC PRIVATE KEY-----
MHQCAQEEIEYgBlyQVsH7SpHUH7x4RErcckhu7ary/JjhP72Nk19EoAcGBSuBBAAK
oUQDQgAE1MtHIxlGP5TARqBccrddNm1FnYH1Fp+onETz5KbXPSeG5FGwKMUXGfAm
SZJq2gENULFewwymt+9bTXkjBZhh8A==
-----END EC PRIVATE KEY-----";

BLOCK:JwtEncode
  algorithm = ES256
  secret = @privateKey
  payload = "{\"open\":\"bullet\"}"
  => VAR @jwtEncodeOutput
ENDBLOCK
openbullet commented 4 months ago

Thanks again! Please next time ask to merge into the staging branch instead of master if you can, thanks 😉