From 302828905d3d9e7cf544675e0b6804c39f375717 Mon Sep 17 00:00:00 2001 From: Stephen Fox Date: Thu, 28 Feb 2019 09:42:20 -0500 Subject: [PATCH] Move 'FromPrivateKeyConfig' closer to caller. Per review feedback. --- helper/ssh/key_pair.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/helper/ssh/key_pair.go b/helper/ssh/key_pair.go index 906fde465..0922d3dfa 100644 --- a/helper/ssh/key_pair.go +++ b/helper/ssh/key_pair.go @@ -51,18 +51,6 @@ type CreateKeyPairConfig struct { Name string } -// FromPrivateKeyConfig describes how an SSH key pair should be loaded from an -// existing private key. -type FromPrivateKeyConfig struct { - // RawPrivateKeyPemBlock is the raw private key that the key pair - // should be loaded from. - RawPrivateKeyPemBlock []byte - - // Name is the resulting key pair's name. This is used to identify - // the key pair in the SSH server's 'authorized_keys'. - Name string -} - // KeyPair represents an SSH key pair. type KeyPair struct { // PrivateKeyPemBlock represents the key pair's private key in @@ -134,6 +122,18 @@ func KeyPairFromPrivateKey(config FromPrivateKeyConfig) (KeyPair, error) { return KeyPair{}, fmt.Errorf("Cannot parse existing SSH key pair - unknown key pair type") } +// FromPrivateKeyConfig describes how an SSH key pair should be loaded from an +// existing private key. +type FromPrivateKeyConfig struct { + // RawPrivateKeyPemBlock is the raw private key that the key pair + // should be loaded from. + RawPrivateKeyPemBlock []byte + + // Name is the resulting key pair's name. This is used to identify + // the key pair in the SSH server's 'authorized_keys'. + Name string +} + // NewKeyPair generates a new SSH key pair using the specified // CreateKeyPairConfig. func NewKeyPair(config CreateKeyPairConfig) (KeyPair, error) {