Ejemplo n.º 1
0
        private void CheckNotifySign(LianLianPayDictionary para, List <string> excludePara)
        {
            if (para.Count == 0)
            {
                throw new Exception("sign check fail: para is Empty!");
            }

            if (para.TryGetValue("sign", out var sign))
            {
                var prestr = LianLianPaySecurity.GetSignContent(para, excludePara);
                if (!MD5WithRSA.VerifyData(prestr, sign, PublicKey))
                {
                    throw new Exception("sign check fail: check Sign and Data Fail JSON also");
                }
            }
        }
Ejemplo n.º 2
0
        private void CheckNotifySign(LianLianPayDictionary dictionary, LianLianPayOptions options)
        {
            if (dictionary == null || dictionary.Count == 0)
            {
                throw new LianLianPayException("sign check fail: dictionary is Empty!");
            }

            if (!dictionary.TryGetValue("sign", out var sign))
            {
                throw new LianLianPayException("sign check fail: sign is Empty!");
            }

            var prestr = LianLianPaySecurity.GetSignContent(dictionary);

            if (!MD5WithRSA.VerifyData(prestr, sign, options.PublicKey))
            {
                throw new LianLianPayException("sign check fail: check Sign and Data Fail JSON also");
            }
        }