MCPcopy Create free account
hub / github.com/docker/cli / newKeyLoadCommand

Function newKeyLoadCommand

cmd/docker-trust/trust/key_load.go:30–44  ·  view source on GitHub ↗
(dockerCLI command.Streams)

Source from the content-addressed store, hash-verified

28}
29
30func newKeyLoadCommand(dockerCLI command.Streams) *cobra.Command {
31 var options keyLoadOptions
32 cmd := &cobra.Command{
33 Use: "load [OPTIONS] KEYFILE",
34 Short: "Load a private key file for signing",
35 Args: cli.ExactArgs(1),
36 RunE: func(cmd *cobra.Command, args []string) error {
37 return loadPrivKey(dockerCLI, args[0], options)
38 },
39 DisableFlagsInUseLine: true,
40 }
41 flags := cmd.Flags()
42 flags.StringVar(&options.keyName, "name", "signer", "Name for the loaded key")
43 return cmd
44}
45
46func loadPrivKey(streams command.Streams, keyPath string, options keyLoadOptions) error {
47 // validate the key name if provided

Callers 2

TestTrustKeyLoadErrorsFunction · 0.85
newTrustKeyCommandFunction · 0.85

Calls 1

loadPrivKeyFunction · 0.85

Tested by 1

TestTrustKeyLoadErrorsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…