data/account.go
func EncryptedKey(pkey *ecdsa.PrivateKey, auth string) (Base64String, error) {
	key := keystore.NewKeyForDirectICAP(rand.Reader)
	key.Address = crypto.PubkeyToAddress(pkey.PublicKey)
	key.PrivateKey = pkey
	encryptedBytes, err := keystore.EncryptKey(key, auth,
		keystore.StandardScryptN,
		keystore.StandardScryptP)
	if err != nil {
		return "", err
	}
	return FromBytes(encryptedBytes), nil
}
func EncryptedKey(pkey *ecdsa.PrivateKey, auth string) (Base64String, error) {
	key := keystore.NewKeyForDirectICAP(rand.Reader)
	key.Address = crypto.PubkeyToAddress(pkey.PublicKey)
	key.PrivateKey = pkey
	encryptedBytes, err := keystore.EncryptKey(key, auth,
		keystore.StandardScryptN,
		keystore.StandardScryptP)
	if err != nil {
		return "", err
	}
	return FromBytes(encryptedBytes), nil
}
func EncryptedKey ( pkey * ecdsa . PrivateKey , auth string ) ( Base64String , error ) { key := keystore . NewKeyForDirectICAP ( rand . Reader ) key . Address = crypto . PubkeyToAddress ( pkey . PublicKey ) key . PrivateKey = pkey encryptedBytes , err := keystore . EncryptKey ( key , auth , keystore . StandardScryptN , keystore . StandardScryptP ) if err != nil { return " " , err } return FromBytes ( encryptedBytes ) , nil }
// EncryptedKey returns encrypted keystore.Key in base64.
EncryptedKey returns encrypted keystore . Key in base64 .