Open coleglencairn opened 3 months ago
I can't reproduce this, filling in var key
with the private key from transport_test.go
.
Are you sure you're reading the private key from disk correctly (and not passing the file name for example)?
This would be an issue with ghinstallation
rather than the github
package because if authentication is failing, it's happening before you reach github.NewClient
.
Hi, I am trying to use the
New()
method to create a transport for use in my github client, but I am having trouble with my RSA key being parsed. When I usedNewKeyFromFile()
everything worked fine, but swapping toNew()
and feeding in a string of the key as a byte gives me the following error:could not parse private key: Invalid Key: Key must be PEM encoded PKCS1 or PKCS8 private key
. I am confused by this because intransport_test.go
you are doing it the exact same way and I have to assume the tests are passing. I'm not sure if this is an issue in ghinstallation or go-github. Am I missing something?New()
: https://github.com/bradleyfalzon/ghinstallation/blob/d680810648e94347929da00376d1e7067f3572dd/transport_test.go#L167My code is like this: