1
0
mirror of https://github.com/smallstep/cli.git synced 2025-08-09 03:22:43 +03:00
This commit is contained in:
Dominik Roos
2021-12-02 22:38:16 +01:00
parent 953d552603
commit 8de234779b
11 changed files with 88 additions and 43 deletions

View File

@@ -3,18 +3,19 @@ package ssh
import (
"fmt"
"github.com/smallstep/cli/command"
libfingerprint "github.com/smallstep/cli/crypto/fingerprint"
"github.com/smallstep/cli/crypto/sshutil"
"github.com/smallstep/cli/utils"
"github.com/urfave/cli"
"go.step.sm/cli-utils/command"
libcommand "go.step.sm/cli-utils/command"
"go.step.sm/cli-utils/errs"
)
func fingerPrintCommand() cli.Command {
return cli.Command{
Name: "fingerprint",
Action: command.ActionFunc(fingerprint),
Action: libcommand.ActionFunc(fingerprint),
Usage: "print the fingerprint of an SSH public key or certificate",
UsageText: `**step ssh fingerprint** <file>`,
Description: `**step ssh fingerprint** prints the fingerprint of an ssh public key or
@@ -37,7 +38,7 @@ Print the fingerprint for an SSH public key:
$ step ssh fingerprint id_ecdsa.pub
'''`,
Flags: []cli.Flag{
command.FingerprintFormatFlag(),
command.FingerprintFormatFlag("base64-raw"),
},
}
}
@@ -54,7 +55,7 @@ func fingerprint(ctx *cli.Context) error {
)
if format != "" {
encoding, err := command.GetFingerprintEncoding(format, "hex")
encoding, err := command.GetFingerprintEncoding(format)
if err != nil {
return err
}