import/export accounts
- cli: add passwordfile flag - cli: change unlock flag only takes account - cli: with unlock you are prompted for password or use passfile with password flag - cli: unlockAccount used in normal client start (run) and accountExport - cli: getPassword used in accountCreate and accountImport - accounts: Manager.Import, Manager.Export - crypto: SaveECDSA (to complement LoadECDSA) to save to file - crypto: NewKeyFromECDSA added (used in accountImport and New = generated constructor)
This commit is contained in:
@ -139,6 +139,11 @@ func LoadECDSA(file string) (*ecdsa.PrivateKey, error) {
|
||||
return ToECDSA(buf), nil
|
||||
}
|
||||
|
||||
// SaveECDSA saves a secp256k1 private key from the given file.
|
||||
func SaveECDSA(file string, key *ecdsa.PrivateKey) error {
|
||||
return common.WriteFile(file, FromECDSA(key))
|
||||
}
|
||||
|
||||
func GenerateKey() (*ecdsa.PrivateKey, error) {
|
||||
return ecdsa.GenerateKey(S256(), rand.Reader)
|
||||
}
|
||||
|
Reference in New Issue
Block a user