ES256, ES384 are not implemented according to RFC 7518
RFC 7518:
"Generate a digital signature of the JWS Signing Input using ECDSA
P-256 SHA-256 with the desired private key. The output will be
the pair (R, S), where R and S are 256-bit unsigned integers ..."
use the private key and this lib to sign the token
use the signed token generated by this lib and try to validate it using the public key and this tool:
http://kjur.github.io/jsjws/tool_jwt.html (working correct by RFC7518)
ES256, ES384 are not implemented according to RFC 7518
RFC 7518: "Generate a digital signature of the JWS Signing Input using ECDSA P-256 SHA-256 with the desired private key. The output will be the pair (R, S), where R and S are 256-bit unsigned integers ..."
here is the problematic sign method: https://github.com/psecio/jwt/blob/master/src/Psecio/Jwt/Jwt.php#L324
test case:
here is a working implementation with ES256, ES384, etc you can check https://github.com/lcobucci/jwt/blob/master/src/Signer/Ecdsa.php#L82
Regards, Plamen