Add PrivateKeyFileWithPassphrase
fagnercarvalho opened this issue · comments
Fagner Nunes Carvalho commented
Could we please add a PrivateKeyFileWithPassphrase
for parsing private key files with a passphrase?
I can create a PR for it if you want to.
func PrivateKeyFileWithPassphrase(file string, passphrase string) ssh.AuthMethod {
buffer, err := ioutil.ReadFile(file)
if err != nil {
return nil
}
key, err := ssh.ParsePrivateKeyWithPassphrase(buffer, []byte(passphrase))
if err != nil {
return nil
}
return ssh.PublicKeys(key)
}
Elliot Chance commented
Yes. Please add a PR for this :)