From 3ebfeb75f40d31dcd87a03fdcd942b2dad142a4f Mon Sep 17 00:00:00 2001 From: Mariano Cano Date: Mon, 22 Oct 2018 18:49:39 -0700 Subject: [PATCH] Improve docs for `step ca root` --- command/ca/root.go | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/command/ca/root.go b/command/ca/root.go index f1c6a658..f0d25f23 100644 --- a/command/ca/root.go +++ b/command/ca/root.go @@ -20,7 +20,33 @@ func rootComand() cli.Command { UsageText: `**step ca root** [--fingerprint=] [**--ca-url**=]`, Description: `**step ca root** downloads and validates the root certificate from the -certificate authority.`, +certificate authority. + +## POSITIONAL ARGUMENTS + + +: File to write root certificate (PEM format) + +## EXAMPLES + +Get the root fingerprint in the CA: +''' +$ step certificate fingerprint /path/to/root_ca.crt +0d7d3834cf187726cf331c40a31aa7ef6b29ba4df601416c9788f6ee01058cf3 +''' + +Download the root certificate from the configured certificate authority: +''' +$ step ca root root_ca.crt \ + --fingerprint 0d7d3834cf187726cf331c40a31aa7ef6b29ba4df601416c9788f6ee01058cf3 +''' + +Download the root certificate using a given certificate authority: +''' +$ step ca root root_ca.crt \ + --ca-url https://ca.smallstep.com:9000 \ + --fingerprint 0d7d3834cf187726cf331c40a31aa7ef6b29ba4df601416c9788f6ee01058cf3 +'''`, Flags: []cli.Flag{ cli.StringFlag{ Name: "fingerprint", @@ -56,6 +82,7 @@ func rootAction(ctx *cli.Context) error { return err } + // Root already validates the certificate resp, err := client.Root(fingerprint) if err != nil { return errors.Wrap(err, "error downloading root certificate")