public static object ObjectFromEncryptedJSON(string data) { WalletEncryptionV2 enc = new WalletEncryptionV2(); string secured = enc.Decrypt(data); return(Newtonsoft.Json.JsonConvert.DeserializeObject(secured)); }
public static T ObjectFromEncryptedJSON <T>(string data) { WalletEncryptionV2 enc = new WalletEncryptionV2(); try { string secured = enc.Decrypt(data); return(Newtonsoft.Json.JsonConvert.DeserializeObject <T>(secured)); } catch (Exception ex) { ex.ToString(); } return(default(T)); }
public static string ObjectToEncryptedJSON(object obj) { string ret = Newtonsoft.Json.JsonConvert.SerializeObject(obj); WalletEncryptionV2 enc = new WalletEncryptionV2(); string secured = ""; if (!string.IsNullOrEmpty(ret)) { try { secured = enc.encrypt(ret); } catch (Exception ex) { ex.ToString(); } } return(secured); }