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

Some private keys not supported #16

Open
tyuen opened this issue Mar 10, 2022 · 0 comments
Open

Some private keys not supported #16

tyuen opened this issue Mar 10, 2022 · 0 comments

Comments

@tyuen
Copy link

tyuen commented Mar 10, 2022

When calling sign, an exception was thrown about atob being called with invalid text.

After debugging, I narrowed it down to the pemToArrayBuffer call and it turns out my private key didn't begin with:
"-----BEGIN PRIVATE KEY-----"
but began with
"-----BEGIN RSA PRIVATE KEY-----"

I was able to resolve this by converting the private key to the correct format with:

openssl pkcs8 -topk8 -nocrypt -in private.pem -out private2.pem

Maybe you could put something in the FAQ in case someone encounters this.

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

1 participant