public String GetVaultAsJson() { var obj = new SecureVaultObject <String> { Created = DateTime.Now, Objects = _vaultObjects }; string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(obj); return(jsonString); }
/// <summary> /// Loads the vault from disk using given FileName; /// </summary> public void Load() { ValidateFileName(); if (!System.IO.File.Exists(FullFileName)) { throw new ArgumentException($"File '{FullFileName}' not found"); } string contents = System.IO.File.ReadAllText(FullFileName); SecureVaultObject <String> svo = Newtonsoft.Json.JsonConvert.DeserializeObject <SecureVaultObject <String> >(contents); _vaultObjects = svo.Objects; }