Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the required RSA public key encoding format(s). #475

Open
feidtmb opened this issue Jul 15, 2020 · 3 comments
Open

Clarify the required RSA public key encoding format(s). #475

feidtmb opened this issue Jul 15, 2020 · 3 comments
Assignees

Comments

@feidtmb
Copy link

feidtmb commented Jul 15, 2020

What Happened

  1. Generated an RSA key pair.
  2. Pasted the private key into the jwt.io debugger with the PS256 algorithm selected.
  3. Pasted the PEM-format public key into the debugger and received a signature verification failed message.
    • Key encoded using ssh-keygen -f key.pub -e -m pem
  4. Confused.
  5. Realized key needed to be encoded in PKCS8.

Requested Changes

Clarify what format the public key needs to be in, either in the input field or in the signature verification failed message. As-is, I don't believe this information is conveyed anywhere, and the input field simply states to use "plain text".

@frazeradam
Copy link

I was working with @feidtmb on the project where we were using this for testing generated tokens, and I think I can add a bit more detail.

As I understand it there are multiple format for RSA Public/Private keys, with the typical PEM headers (RSA) PRIVATE/PUBLIC KEY.

RSA PRIVATE KEY: PKCS#1
PRIVATE KEY: PKCS#8
RSA PUBLIC KEY: PKCS#1
PUBLIC KEY: PKIX

At least for public keys, only the latter works, though there is no useful feedback or documentation on this. I haven't experimented enough with the private keys to know what is required there.

As background, we're generating the tokens from Go, and exporting keys using https://golang.org/pkg/crypto/x509/#MarshalPKCS1PrivateKey

@stale
Copy link

stale bot commented Nov 17, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you have not received a response for our team (apologies for the delay) and this is still a blocker, please reply with additional information or just a ping. Thank you for your contribution! 🙇‍♂️

@stale stale bot added the closed:stale label Nov 17, 2020
@stale stale bot closed this as completed Nov 24, 2020
@DanOnCall DanOnCall reopened this Jun 18, 2024
@stale stale bot removed the closed:stale label Jun 18, 2024
@DanOnCall
Copy link
Contributor

I am reopening this issue as I think this is helpful guidance to add in the next version of jwt.io :)

@DanOnCall DanOnCall self-assigned this Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants