Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &cobra.Command{ Use: "keys", Short: "Utilities to manage keys", TraverseChildren: true, }
View Source
var DecodeCommand = &command.Command{ Cmd: &cobra.Command{ Use: "decode <rlp encoded account key>", Short: "Decode a rlp encoded account key", Args: cobra.ExactArgs(1), Example: "flow keys decode f847b8408...2402038203e8", }, Flags: &decodeFlags, Run: func( cmd *cobra.Command, args []string, globalFlags command.GlobalFlags, services *services.Services, ) (command.Result, error) { rlpEncoded := args[0] accountKey, err := services.Keys.Decode(rlpEncoded) if err != nil { return nil, err } pubKey := accountKey.PublicKey return &KeyResult{publicKey: pubKey, accountKey: accountKey}, err }, }
View Source
var GenerateCommand = &command.Command{ Cmd: &cobra.Command{ Use: "generate", Short: "Generate a new key-pair", Example: "flow keys generate", }, Flags: &generateFlags, Run: func( cmd *cobra.Command, args []string, globalFlags command.GlobalFlags, services *services.Services, ) (command.Result, error) { if generateFlags.Algo != "" { fmt.Println("⚠️ DEPRECATION WARNING: flag no longer supported, use '--sig-algo' instead.") generateFlags.KeySigAlgo = generateFlags.Algo } privateKey, err := services.Keys.Generate(generateFlags.Seed, generateFlags.KeySigAlgo) if err != nil { return nil, err } pubKey := privateKey.PublicKey() return &KeyResult{privateKey: privateKey, publicKey: pubKey}, nil }, }
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.