Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ParseETHWalletCmd = &cobra.Command{ Use: "parseethwallet [flags]", Short: "Extract the private key from an eth wallet.", Long: usage, RunE: func(cmd *cobra.Command, args []string) error { if *inputRawHexPrivateKey != "" { trimmedHexPrivateKey := strings.TrimPrefix(*inputRawHexPrivateKey, "0x") ks := keystore.NewKeyStore(*inputKeyStoreDirectory, keystore.StandardScryptN, keystore.StandardScryptP) pk, err := crypto.HexToECDSA(trimmedHexPrivateKey) if err != nil { return err } _, err = ks.ImportECDSA(pk, *inputPassword) if err != nil { return err } return nil } rawData, err := getInputData(cmd, args) if err != nil { return err } k := new(gethkeystore.RawKeystoreData) err = json.Unmarshal(rawData, &k) if err != nil { return err } d, err := keystore.DecryptDataV3(k.Crypto, *inputPassword) if err != nil { return err } ok := toOutputKey(d) outData, err := json.Marshal(ok) if err != nil { return err } fmt.Println(string(outData)) return nil }, Args: func(cmd *cobra.Command, args []string) error { return nil }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.