public static InitKey CreateInitKeyEntity(byte[] randomEncryKey, ECDHKey cliPubECDHKey, string string_0, string wxPwd) { InitKey.Builder builder = new InitKey.Builder(); SKBuiltinBuffer_t.Builder builder2 = new SKBuiltinBuffer_t.Builder(); builder2.SetILen(16); builder2.SetBuffer(ByteString.CopyFrom(randomEncryKey)); builder.SetRandomEncryKey(builder2); builder.SetCliPubECDHKey(cliPubECDHKey); builder.SetAccount(string_0); string text = FormsAuthentication.HashPasswordForStoringInConfigFile(wxPwd, "MD5"); builder.SetPwd(text); builder.SetPwd2(text); return(builder.Build()); }
public static InitKey CreateInitKeyEntity(byte[] randomEncryKey, ECDHKey cliPubECDHKey, string WXAccount, string wxPwd) { InitKey.Builder key = new InitKey.Builder(); SKBuiltinBuffer_t.Builder skbb = new SKBuiltinBuffer_t.Builder(); skbb.SetILen(16); skbb.SetBuffer(ByteString.CopyFrom(randomEncryKey)); key.SetRandomEncryKey(skbb); key.SetCliPubECDHKey(cliPubECDHKey); key.SetAccount(WXAccount); string strWxPwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(wxPwd, "MD5"); key.SetPwd(strWxPwd); key.SetPwd2(strWxPwd); return(key.Build()); }