Keats / jsonwebtoken

JWT lib in rust
MIT License
1.67k stars 266 forks source link

Support certificates as public keys #259

Closed qianxi0410 closed 1 year ago

qianxi0410 commented 2 years ago

When I use the certificate-private key mode, I have the certificate as the public key, but when I use public key(certificate) parsing, the program keeps telling me that the key format is not correct.

And I just replace the format as follows, and it works fine:

before:

-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----

-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----

after:

-----BEGIN PUBLIC KEY-----
...
-----END PUBLIC KEY-----

-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
jetaggart commented 2 years ago

I have this issue as well. Firebase has the certificate format: https://www.googleapis.com/robot/v1/metadata/x509/securetoken@system.gserviceaccount.com

Alexey-N-Chernyshov commented 1 year ago

Done, may be closed.