Skip to content

Commit 6703c03

Browse files
committed
differentiate between output types for --csr
1 parent 2d096e3 commit 6703c03

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

command/certificate/create.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,9 @@ func createAction(ctx *cli.Context) error {
230230
}
231231

232232
var (
233-
priv interface{}
234-
pubPEM *pem.Block
233+
priv interface{}
234+
pubPEM *pem.Block
235+
outputType string
235236
)
236237
switch typ {
237238
case "x509-csr":
@@ -258,6 +259,7 @@ func createAction(ctx *cli.Context) error {
258259
Bytes: csrBytes,
259260
Headers: map[string]string{},
260261
}
262+
outputType = "certificate signing request"
261263
case "x509":
262264
var (
263265
err error
@@ -319,6 +321,7 @@ func createAction(ctx *cli.Context) error {
319321
Headers: map[string]string{},
320322
}
321323
priv = profile.SubjectPrivateKey()
324+
outputType = "certificate"
322325
default:
323326
return errs.NewError("unexpected type: %s", typ)
324327
}
@@ -344,7 +347,7 @@ func createAction(ctx *cli.Context) error {
344347
}
345348
}
346349

347-
ui.Printf("Your certificate has been saved in %s.\n", crtFile)
350+
ui.Printf("Your %s has been saved in %s.\n", outputType, crtFile)
348351
ui.Printf("Your private key has been saved in %s.\n", keyFile)
349352

350353
return nil

0 commit comments

Comments
 (0)