From fa3f87a5f61356ba8205b6002644215cdebb2293 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 11 Aug 2013 16:15:10 -0700 Subject: [PATCH] communicator/ssh: docs --- communicator/ssh/keychain.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/communicator/ssh/keychain.go b/communicator/ssh/keychain.go index 4c794322d..5a63f0380 100644 --- a/communicator/ssh/keychain.go +++ b/communicator/ssh/keychain.go @@ -10,6 +10,9 @@ import ( "io" ) +// SimpleKeychain makes it easy to use private keys in order to connect +// via SSH, since the interface exposed by Go isn't the easiest to use +// right away. type SimpleKeychain struct { keys []interface{} } @@ -26,6 +29,8 @@ func (k *SimpleKeychain) AddPEMKey(key string) (err error) { return } +// AddPEMKeyPassword adds a PEM encoded private key that is protected by +// a password to the keychain. func (k *SimpleKeychain) AddPEMKeyPassword(key string, password string) (err error) { block, _ := pem.Decode([]byte(key)) bytes, _ := x509.DecryptPEMBlock(block, []byte(password))