Ejemplo n.º 1
0
 public static void GetValideKey()
 {
     if (CheckValidateKey()) return;
     var get = new HttpRequestGet();
     var userKey = get.GetUserKey(Singleton.Singleton.Instance().CurrentUser.id.ToString());
     userKey.ContinueWith(delegate(Task<object> task)
     {
         var key = task.Result as String;
         if (key != null)
         {
             var obj = JsonConvert.DeserializeObject(key, typeof (Key)) as Key;
             var stringEncrypt = obj.key;
             Singleton.Singleton.Instance().Key = obj;
             Singleton.Singleton.Instance().SecureKey =
                 EncriptSha256.EncriptStringToSha256(Singleton.Singleton.Instance().CurrentUser.salt +
                                                     stringEncrypt);
         }
     });
 }