Beispiel #1
0
        public override bool VerifySignature(ActionParameter para)
        {
            Merchant.OAuthApp app = Merchant.OAuthApp.GetOAuthApp(para.MerchantNo);
            if (app == null)
            {
                return(false);
            }
            if (!app.IsValid())
            {
                return(false);
            }
            string secretKey = app.Secret_Key;
            //签名数据
            string signValue = para.Data + secretKey;
            //签名结果
            string signResult = MD5Provider.Encode(signValue);

            //验证签名
            if (!signResult.Equals(para.Sign, StringComparison.CurrentCultureIgnoreCase))
            {
                Log.Info("签名错误:");
                Log.Info("签名数据:" + signValue);
                Log.Info("签名结果:" + signResult);
                return(false);
            }
            return(true);
        }
Beispiel #2
0
 public void OauthAppTest()
 {
     Merchant.OAuthApp app = Merchant.OAuthApp.GetOAuthApp("appversioncontrol");
     Assert.IsTrue(app != null);
 }