gr2m / universal-github-app-jwt

Calculate GitHub App bearer tokens for Node & modern browsers
MIT License
23 stars 11 forks source link

Add support for OpenSSH #72

Open gr2m opened 1 year ago

gr2m commented 1 year ago

I like storing GitHub App credentials in 1Password as ssh keys. Unfortunately 1Password started to convert all RSA private keys (which is what GitHub provides) into an OpenSSH format which this library cannot handle.

I hope that it can though, I just didn't have time to look into it yet.

If anyone would be so inclined to have a look, I'd very much appreciate it.

Here is an example key from https://coolaj86.com/articles/the-openssh-private-key-format/

-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAaAAAABNlY2RzYS
1zaGEyLW5pc3RwMjU2AAAACG5pc3RwMjU2AAAAQQR9WZPeBSvixkhjQOh9yCXXlEx5CN9M
yh94CJJ1rigf8693gc90HmahIR5oMGHwlqMoS7kKrRw+4KpxqsF7LGvxAAAAqJZtgRuWbY
EbAAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBH1Zk94FK+LGSGNA
6H3IJdeUTHkI30zKH3gIknWuKB/zr3eBz3QeZqEhHmgwYfCWoyhLuQqtHD7gqnGqwXssa/
EAAAAgBzKpRmMyXZ4jnSt3ARz0ul6R79AXAr5gQqDAmoFeEKwAAAAOYWpAYm93aWUubG9j
YWwBAg==
-----END OPENSSH PRIVATE KEY-----
gr2m commented 1 year ago

I added at least a helpful error message and updated the README via https://github.com/gr2m/universal-github-app-jwt/pull/74