virtual internal void Put(EventTrigger trigger, JSONObject action)
        {
            InitialiseSalt();

            string contents = null;

            try {
                var json = new JSONObject()
                {
                    { "contents", action },
                    { "hash", Convert.ToBase64String(GeneratedSaltedHash(
                                                         Encoding.UTF8.GetBytes(MiniJSON.Json.Serialize(action)),
                                                         salt)) }
                };

                contents = MiniJSON.Json.Serialize(json);
            } catch (Exception e) {
                Logger.LogWarning(string.Format(
                                      "Unable to serialise action {0} due to {1}",
                                      action,
                                      e.Message));
                return;
            }

            lock (LOCK) {
                File.WriteAllText(location + trigger.GetCampaignId(), contents);
            }
        }
 virtual internal void Remove(EventTrigger trigger)
 {
     lock (LOCK) {
         var file = location + trigger.GetCampaignId();
         if (File.Exists(file))
         {
             File.Delete(file);
         }
     }
 }
        virtual internal JSONObject Get(EventTrigger trigger)
        {
            string contents = null;

            var file = location + trigger.GetCampaignId();

            lock (LOCK) {
                if (File.Exists(file))
                {
                    contents = File.ReadAllText(file);
                }
                else
                {
                    return(null);
                }
            }

            try {
                var json   = MiniJSON.Json.Deserialize(contents) as JSONObject;
                var action = json["contents"] as JSONObject;

                var persistedHash = Convert.FromBase64String(json["hash"] as string);
                var hash          = GeneratedSaltedHash(
                    Encoding.UTF8.GetBytes(MiniJSON.Json.Serialize(action)),
                    salt);
                if (!(persistedHash.Length == hash.Length &&
                      !persistedHash.Where((t, i) => t != hash[i]).Any()))
                {
                    Logger.LogWarning("Mismatched hash for action " + contents);
                    File.Delete(file);
                    return(null);
                }

                return(action);
            } catch (Exception e) {
                Logger.LogWarning(string.Format(
                                      "Unable to deserialise action {0} due to {1}",
                                      contents,
                                      e.Message));
                return(null);
            }
        }