Hi,
I've been recently implementing Sign-in with Apple. Got a private key from Apple which turned out to be signed with ES256, secp256r1 curve. Unfortunately, this curve name is not supported by ruby-jwt. Worse - it rises an ambiguous message: "payload algorithm is ES256 but signing key was provided". That's because JWT::Algos::Ecdsa::NAMED_CURVES has no 'secp256r1' key.
Question: Is it deliberate or may I make a pull request to fix this (add the curve name to NAMED_CURVES and fix the exception message for future unlisted names)?
How to reproduce:
ecdsa_key = OpenSSL::PKey::EC.new 'secp256r1'
ecdsa_key.generate_key
ecdsa_key.check_key # true
JWT.encode "", ecdsa_key, 'ES256' # raises: JWT::IncorrectAlgorithm (payload algorithm is ES256 but signing key was provided)
~mare