예제 #1
0
        /// <summary>
        /// Validates event data.
        /// </summary>
        /// <param name="data">A data to be validated.</param>
        /// <param name="xTeamsSignature">X-Spark-Signature header value that is notified on event.</param>
        /// <returns>true if the event is valid, false if the event is invalid.</returns>
        public bool Validate(byte[] data, string xTeamsSignature)
        {
            // Default result is false.
            bool result = false;

            if (this.hashString != null && data != null && data.Length > 0 && !String.IsNullOrEmpty(xTeamsSignature))
            {
                result = (xTeamsSignature.ToLower() == hashString.ComputeString(data));
            }

            return(result);
        }