private void CheckIsTimeStampValid(ApiRequestEntity requestData)
 {
     //// Check is timestamp valid
     if (!this.ChiperTextHelper.CheckTimestampInRange(requestData.TimeStamp, 86400 * 30))
     {
         throw new AuthorizeTokenFailureException("Timestamp not valid!");
     }
 }
        private void CheckIsSignatureValid(ApiRequestEntity requestData, UserModel userData)
        {
            var expectSignature = this.ChiperTextHelper
                                      .GetSignature(userData.EncryptKey, userData.SaltKey, requestData.TimeStamp, requestData.Data);

            if (requestData.Signature != expectSignature)
            {
                throw new AuthorizeTokenFailureException("Signature not valid!");
            }
        }
        private ApiRequestEntity GetApiRequestEntity(AuthorizationContext filterContext)
        {
            ApiRequestEntity entity = new ApiRequestEntity();

            entity.Token = this.GetDataFromValueProvider(filterContext, "token");
            entity.TimeStamp = this.GetDataFromValueProvider(filterContext, "timestamp");
            entity.Signature = this.GetDataFromValueProvider(filterContext, "signature");
            entity.Data = this.GetDataFromValueProvider(filterContext, "data");

            return entity;
        }