Creating ES256 signature for Apple JWT

I am attempting to create an ES256 JWT header in order to communicate with the Apple App Store Connect API. I’ve been having trouble generating a correct ES256 JWT signature, I’ve been trying to use the MBS ECKeyMBS class to do a sha256 hash and then signing it using curve secp256r1 (MBS ID 415) and using base64url encode to finalise it but just can’t seem to get it to work. After a lot of googling I found this which implies that anything OpenSSL related can’t do it out of the box How to use openssl to generate a JWT using ES256 alogrithm - Stack Overflow

Has anyone managed to create ES256 signatures using Xojo succesfully?

I’ve got a helper app written in go-lang that does this because I gave up on doing it in Xojo.


You could use Chilkat plugin, i’m using it for 2 years already and it does the job perfectly .

here you have some example code

1 Like

Thanks for the responses, looks like I’ll end up doing something similar to the helper app as unfortunately adding a new paid plug in isn’t an option.