Removed keys stub
This commit is contained in:
parent
b0c65f8045
commit
58f2cbfa38
|
@ -60,7 +60,6 @@ func GetCommands(cmds ...*cobra.Command) []*cobra.Command {
|
|||
func PostCommands(cmds ...*cobra.Command) []*cobra.Command {
|
||||
for _, c := range cmds {
|
||||
c.Flags().String(flagName, "", "Name of private key with which to sign")
|
||||
c.Flags().String(flagPassword, "", "Password to use the named private key")
|
||||
}
|
||||
return cmds
|
||||
}
|
||||
|
|
|
@ -1,77 +0,0 @@
|
|||
package main
|
||||
|
||||
import "github.com/spf13/cobra"
|
||||
|
||||
const (
|
||||
flagPassword = "password"
|
||||
flagNewPassword = "new-password"
|
||||
flagType = "type"
|
||||
flagSeed = "seed"
|
||||
flagDryRun = "dry-run"
|
||||
)
|
||||
|
||||
var (
|
||||
listKeysCmd = &cobra.Command{
|
||||
Use: "list",
|
||||
Short: "List all locally availably keys",
|
||||
RunE: todoNotImplemented,
|
||||
}
|
||||
|
||||
showKeysCmd = &cobra.Command{
|
||||
Use: "show <name>",
|
||||
Short: "Show key info for the given name",
|
||||
RunE: todoNotImplemented,
|
||||
}
|
||||
)
|
||||
|
||||
// KeyCommands registers a sub-tree of commands to interact with
|
||||
// local private key storage.
|
||||
func KeyCommands() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "keys",
|
||||
Short: "Add or view local private keys",
|
||||
}
|
||||
cmd.AddCommand(
|
||||
addKeyCommand(),
|
||||
listKeysCmd,
|
||||
showKeysCmd,
|
||||
lineBreak,
|
||||
deleteKeyCommand(),
|
||||
updateKeyCommand(),
|
||||
)
|
||||
return cmd
|
||||
}
|
||||
|
||||
func addKeyCommand() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "add <name>",
|
||||
Short: "Create a new key, or import from seed",
|
||||
RunE: todoNotImplemented,
|
||||
}
|
||||
cmd.Flags().StringP(flagPassword, "p", "", "Password to encrypt private key")
|
||||
cmd.Flags().StringP(flagType, "t", "ed25519", "Type of private key (ed25519|secp256k1|ledger)")
|
||||
cmd.Flags().StringP(flagSeed, "s", "", "Provide seed phrase to recover existing key instead of creating")
|
||||
cmd.Flags().Bool(flagDryRun, false, "Perform action, but don't add key to local keystore")
|
||||
return cmd
|
||||
}
|
||||
|
||||
func updateKeyCommand() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "update <name>",
|
||||
Short: "Change the password used to protect private key",
|
||||
RunE: todoNotImplemented,
|
||||
}
|
||||
cmd.Flags().StringP(flagPassword, "p", "", "Current password to decrypt key")
|
||||
cmd.Flags().String(flagNewPassword, "", "New password to use to protect key")
|
||||
return cmd
|
||||
}
|
||||
|
||||
func deleteKeyCommand() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "delete <name>",
|
||||
Short: "Delete the given key",
|
||||
RunE: todoNotImplemented,
|
||||
}
|
||||
cmd.Flags().StringP(flagPassword, "p", "", "Password of existing key to delete")
|
||||
return cmd
|
||||
}
|
Loading…
Reference in New Issue