Skip to content

Commit

Permalink
Reverting to original impl. of 'ImportKeyCommand(...)' fucntion
Browse files Browse the repository at this point in the history
  • Loading branch information
pbukva committed Oct 31, 2024
1 parent 47681f4 commit fab9223
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions client/keys/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

// ImportKeyCommand imports private keys from a keyfile.
func ImportKeyCommand() *cobra.Command {
cmd := &cobra.Command{
return &cobra.Command{
Use: "import <name> <keyfile>",
Short: "Import private keys into the local keybase",
Long: "Import a ASCII armored private key into the local keybase.",
Expand All @@ -29,21 +29,20 @@ func ImportKeyCommand() *cobra.Command {
return err
}
buf := bufio.NewReader(clientCtx.Input)
passphrase, err := input.GetPassword("Enter passphrase to decrypt your key:", buf)

bz, err := os.ReadFile(args[1])
if err != nil {
return err
}

bz, err := os.ReadFile(args[1])
passphrase, err := input.GetPassword("Enter passphrase to decrypt your key:", buf)
if err != nil {
return err
}

return clientCtx.Keyring.ImportPrivKey(args[0], string(bz), passphrase)
},
}

return cmd
}

// ImportUnarmoredKeyCommand imports private keys from a keyfile.
Expand Down

0 comments on commit fab9223

Please sign in to comment.