mirror of
https://github.com/hashicorp/packer.git
synced 2026-05-28 04:35:38 -04:00
communicator/ssh: docs
This commit is contained in:
parent
3c5565c541
commit
fa3f87a5f6
1 changed files with 5 additions and 0 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in a new issue