public ResultWrapper <Data> eth_sign(Data address, Data message) { //TODO check how to deal with password SecureString secureString = new SecureString(); secureString.AppendChar('?'); var privateKey = _blockchainBridge.GetKey(new Address(address.Value), secureString); if (privateKey.Item2.ResultType == ResultType.Failure) { return(ResultWrapper <Data> .Fail("Incorrect address")); } var messageText = Encoding.GetEncoding(ConfigurationProvider.MessageEncoding).GetString(message.Value); var signatureText = string.Format(ConfigurationProvider.SignatureTemplate, messageText.Length, messageText); var signature = _blockchainBridge.Sign(privateKey.Item1, Keccak.Compute(signatureText)); Logger.Debug($"eth_sign request {address.ToJson()}, {message.ToJson()}, result: {signature}"); return(ResultWrapper <Data> .Success(new Data(signature.Bytes))); }