aboutsummaryrefslogtreecommitdiff
path: root/ssh/keys.go
diff options
context:
space:
mode:
Diffstat (limited to 'ssh/keys.go')
-rw-r--r--ssh/keys.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/ssh/keys.go b/ssh/keys.go
index 47a0753..18851e7 100644
--- a/ssh/keys.go
+++ b/ssh/keys.go
@@ -1271,6 +1271,12 @@ func (*PassphraseMissingError) Error() string {
return "ssh: this private key is passphrase protected"
}
+// Is return true if the target is an instance of PassphraseMissingError.
+func (errPassMissing *PassphraseMissingError) Is(target error) (ok bool) {
+ _, ok = target.(*PassphraseMissingError)
+ return ok
+}
+
// ParseRawPrivateKey returns a private key from a PEM encoded private key. It supports
// RSA, DSA, ECDSA, and Ed25519 private keys in PKCS#1, PKCS#8, OpenSSL, and OpenSSH
// formats. If the private key is encrypted, it will return a PassphraseMissingError.