Hi!
I was try to encode and sign jwt with ES256 algorithm and key was generated not by me.
And I don't know what kind of key was.
And I fall to same situation as #706 - TypeError: sign() missing 1 required positional argument: 'algorithm'
When I dig in (one hour later) And it was not incompatible pjwt with cryptography.
The key was RSA (without curve)
This PR - throws the explicit exception to check your key.
P.S. Sorry for my poor English and feel free to close this PR without merging it