I am trying to parse a public key using go
's ssh
lib as follows:
var testPublicKey = `ssh-rsa AAAAB3NzaC1yc...DEdfU= pkaramol@MacBookPro`
pubKey, err := ssh.ParsePublicKey(([]byte(testPublicKey)))
if err != nil {
log.Fatal(err)
}
But I am getting the following error:
ssh: short read
I am aware of this question but it addresses a different issue (reading a public key from a file and loading to authorized keys list)
My goal is to end up with an *rsa.PublicKey
type to be used in this function.