Closed francoamato closed 1 month ago
OpenSSL works with PEM format. Seems like Apple exporting the pubkey pair in .P8 is normal... you just need to convert it to pem.
https://github.com/lcobucci/jwt/issues/244 https://forums.developer.apple.com/forums/thread/689212
What happened?
I am trying to create an Apple Login mechanism using Qt and C++. I read that that, unlike Google, with Apple the secret key must be in JWT format so I tried to do it using the jwt-cpp library. I installed jwt-cpp using vcpkg
vcpkg install jwt-cpp
My .p8 file content is: -----BEGIN PRIVATE KEY----- MIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQg6xMHDwAqe0dn4myO mrkVRZLNTr39MK9nOzFz5b55uaWgCgYIKoZIzj0DAQehRANCAAQKY4KrSI6xxVaB A5Cdm9/GXfC+obbw/8uFu3y4HZa6NxGTuT+dNhc0EXB5EkEPSY3iUinBn5XqCJke 4wHd8uUV -----END PRIVATE KEY-----
My code throws the following exception:
JWT generation failed: failed to load key: bio read failed
I need a help in understanding why I am getting such error and if there is a way to solve it
How To Reproduce?
Version
0.7.0
What OS are you seeing the problem on?
Windows
What compiler are you seeing the problem on?
MSVC
Relevant log output
Code of Conduct