()
| 51 | } |
| 52 | |
| 53 | func (p *PrivateKey) isOpenSSHFormatEncrypted() bool { |
| 54 | if p.Block.Type != "OPENSSH PRIVATE KEY" { |
| 55 | return false |
| 56 | } |
| 57 | |
| 58 | _, err := ssh.ParseRawPrivateKey(pem.EncodeToMemory(p.Block)) |
| 59 | if err != nil { |
| 60 | return strings.Contains(err.Error(), "this private key is passphrase protected") |
| 61 | } |
| 62 | return false |
| 63 | } |