From 7b639c8d6466168a9d1429aa6ce939aca2c5bdb9 Mon Sep 17 00:00:00 2001 From: Kurt Kanaskie Date: Mon, 18 Sep 2023 13:48:41 -0400 Subject: [PATCH 1/3] Fix for issues #287 and #288 --- cmd/keyaliases/crtka.go | 4 ++-- cmd/keyaliases/csr.go | 2 +- cmd/keyaliases/getcert.go | 2 +- cmd/keyaliases/getka.go | 3 +-- cmd/keystores/impks.go | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cmd/keyaliases/crtka.go b/cmd/keyaliases/crtka.go index 825cc50ce..aaaeba247 100644 --- a/cmd/keyaliases/crtka.go +++ b/cmd/keyaliases/crtka.go @@ -58,7 +58,7 @@ var CreateCmd = &cobra.Command{ ignoreExpiry, ignoreNewLine, selfFile) - case "pem": + case "keycertfile": _, err = keyaliases.CreateOrUpdateKeyCert(keystoreName, name, false, @@ -93,7 +93,7 @@ func init() { CreateCmd.Flags().StringVarP(&name, "alias", "s", "", "Name of the key alias") CreateCmd.Flags().StringVarP(&format, "format", "f", - "", "Format of the certificate; selfsignedcert, pem or pkcs12 (file extn is .pfx)") + "", "Format of the certificate; selfsignedcert, keycertfile or pkcs12 (file extn is .pfx)") CreateCmd.Flags().StringVarP(&password, "password", "p", "", "PKCS12 password") CreateCmd.Flags().BoolVarP(&ignoreExpiry, "exp", "x", diff --git a/cmd/keyaliases/csr.go b/cmd/keyaliases/csr.go index 09ee5df00..5ae5c71a4 100644 --- a/cmd/keyaliases/csr.go +++ b/cmd/keyaliases/csr.go @@ -41,7 +41,7 @@ func init() { CsrCmd.Flags().StringVarP(&keystoreName, "key", "k", "", "Name of the key store") CsrCmd.Flags().StringVarP(&aliasName, "alias", "s", - "", "Name of the key store") + "", "Name of the key alias") _ = CsrCmd.MarkFlagRequired("alias") _ = CsrCmd.MarkFlagRequired("key") diff --git a/cmd/keyaliases/getcert.go b/cmd/keyaliases/getcert.go index 3d5a3e396..4cb9005e1 100644 --- a/cmd/keyaliases/getcert.go +++ b/cmd/keyaliases/getcert.go @@ -41,7 +41,7 @@ func init() { GetctCmd.Flags().StringVarP(&keystoreName, "key", "k", "", "Name of the key store") GetctCmd.Flags().StringVarP(&aliasName, "alias", "s", - "", "Name of the key store") + "", "Name of the key alias") _ = GetctCmd.MarkFlagRequired("alias") _ = GetctCmd.MarkFlagRequired("key") diff --git a/cmd/keyaliases/getka.go b/cmd/keyaliases/getka.go index 97bd660f7..e3f9d00cb 100644 --- a/cmd/keyaliases/getka.go +++ b/cmd/keyaliases/getka.go @@ -40,9 +40,8 @@ var GetCmd = &cobra.Command{ func init() { GetCmd.Flags().StringVarP(&keystoreName, "key", "k", "", "Name of the key store") - GetCmd.Flags().StringVarP(&aliasName, "alias", "s", - "", "Name of the key store") + "", "Name of the key alias") _ = GetCmd.MarkFlagRequired("alias") _ = GetCmd.MarkFlagRequired("key") diff --git a/cmd/keystores/impks.go b/cmd/keystores/impks.go index 509b64e6f..5ed7099c7 100644 --- a/cmd/keystores/impks.go +++ b/cmd/keystores/impks.go @@ -43,7 +43,7 @@ var ( func init() { ImpCmd.Flags().StringVarP(&filePath, "file", "f", - "", "File containing API Products") + "", "File containing keystores") ImpCmd.Flags().IntVarP(&conn, "conn", "c", 4, "Number of connections") From 6a316b3e37e284e64ddb478d882066357deb82d3 Mon Sep 17 00:00:00 2001 From: Kurt Kanaskie Date: Tue, 19 Sep 2023 11:33:26 -0400 Subject: [PATCH 2/3] Issue 288, keeping pem for backward compatibility. --- cmd/keyaliases/crtka.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/keyaliases/crtka.go b/cmd/keyaliases/crtka.go index aaaeba247..6350bb83f 100644 --- a/cmd/keyaliases/crtka.go +++ b/cmd/keyaliases/crtka.go @@ -58,6 +58,8 @@ var CreateCmd = &cobra.Command{ ignoreExpiry, ignoreNewLine, selfFile) + case "pem": + fallthrough case "keycertfile": _, err = keyaliases.CreateOrUpdateKeyCert(keystoreName, name, @@ -93,7 +95,7 @@ func init() { CreateCmd.Flags().StringVarP(&name, "alias", "s", "", "Name of the key alias") CreateCmd.Flags().StringVarP(&format, "format", "f", - "", "Format of the certificate; selfsignedcert, keycertfile or pkcs12 (file extn is .pfx)") + "", "Format of the certificate; selfsignedcert, keycertfile (a.k.a pem), or pkcs12 (file extn is .pfx)") CreateCmd.Flags().StringVarP(&password, "password", "p", "", "PKCS12 password") CreateCmd.Flags().BoolVarP(&ignoreExpiry, "exp", "x", From fbf5074a3d14493efa4b033a7c0469b1dc246cbc Mon Sep 17 00:00:00 2001 From: Kurt Kanaskie Date: Tue, 19 Sep 2023 11:40:38 -0400 Subject: [PATCH 3/3] Issue 288, keep pem for backward compatibility. --- cmd/keyaliases/crtka.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cmd/keyaliases/crtka.go b/cmd/keyaliases/crtka.go index 6350bb83f..c58d8c5bd 100644 --- a/cmd/keyaliases/crtka.go +++ b/cmd/keyaliases/crtka.go @@ -58,9 +58,7 @@ var CreateCmd = &cobra.Command{ ignoreExpiry, ignoreNewLine, selfFile) - case "pem": - fallthrough - case "keycertfile": + case "keycertfile", "pem": _, err = keyaliases.CreateOrUpdateKeyCert(keystoreName, name, false,