From 02778e60609bc954d0530d52ebf15151c05196df Mon Sep 17 00:00:00 2001 From: Andrew Harding Date: Tue, 4 Dec 2018 10:42:48 -0700 Subject: [PATCH] fix 'api fetch' key PEM header Signed-off-by: Andrew Harding --- cmd/spire-agent/cli/api/fetch_x509.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/spire-agent/cli/api/fetch_x509.go b/cmd/spire-agent/cli/api/fetch_x509.go index 54233ed5fa..560bdbfcb3 100644 --- a/cmd/spire-agent/cli/api/fetch_x509.go +++ b/cmd/spire-agent/cli/api/fetch_x509.go @@ -133,8 +133,9 @@ func (c *fetchX509Command) writeCerts(filename string, data []byte) error { // writeKey takes a private key, formats as PEM, and writes it to filename func (c *fetchX509Command) writeKey(filename string, data []byte) error { + // key data is PKCS8 encoded b := &pem.Block{ - Type: "EC PRIVATE KEY", + Type: "PRIVATE KEY", Bytes: data, }