set correct type for PEM block

pull/10101/head
Adrien Delorme 6 years ago
parent b6efe28a96
commit ca23dab943

@ -47,11 +47,16 @@ func NewPair(public, private interface{}) (*Pair, error) {
}
privBlk := &pem.Block{
Type: "",
Type: "OPENSSH PRIVATE KEY",
Headers: nil,
Bytes: kb,
}
switch private.(type) {
case *rsa.PrivateKey:
privBlk.Type = "RSA PRIVATE KEY"
}
publicKey, err := ssh.NewPublicKey(public)
if err != nil {
return nil, err

Loading…
Cancel
Save