(dockerCLI command.Streams)
| 28 | } |
| 29 | |
| 30 | func 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 | |
| 46 | func loadPrivKey(streams command.Streams, keyPath string, options keyLoadOptions) error { |
| 47 | // validate the key name if provided |
searching dependent graphs…