From 672b22bd13225276235daca4c04874828b599f96 Mon Sep 17 00:00:00 2001 From: Stephen Fox Date: Thu, 28 Feb 2019 09:44:25 -0500 Subject: [PATCH] Move 'CreateKeyPairConfig' closer to callers. Per review feedback. --- helper/ssh/key_pair.go | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/helper/ssh/key_pair.go b/helper/ssh/key_pair.go index 0922d3dfa..55071cf63 100644 --- a/helper/ssh/key_pair.go +++ b/helper/ssh/key_pair.go @@ -36,21 +36,6 @@ func (o KeyPairType) String() string { return string(o) } -// CreateKeyPairConfig describes how an SSH key pair should be created. -type CreateKeyPairConfig struct { - // Type describes the key pair's type. - Type KeyPairType - - // Bits represents the key pair's bits of entropy. E.g., 4096 for - // a 4096 bit RSA key pair, or 521 for a ECDSA key pair with a - // 521-bit curve. - Bits int - - // 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 @@ -236,6 +221,21 @@ func newRsaKeyPair(config CreateKeyPairConfig) (KeyPair, error) { }, nil } +// CreateKeyPairConfig describes how an SSH key pair should be created. +type CreateKeyPairConfig struct { + // Type describes the key pair's type. + Type KeyPairType + + // Bits represents the key pair's bits of entropy. E.g., 4096 for + // a 4096 bit RSA key pair, or 521 for a ECDSA key pair with a + // 521-bit curve. + Bits int + + // 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 +} + // rawPemBlock encodes a pem.Block to a slice of bytes. func rawPemBlock(block *pem.Block) ([]byte, error) { buffer := bytes.NewBuffer(nil)