private void CheckNotifySign(JDPayDictionary parameters)
        {
            if (parameters.Count == 0)
            {
                throw new Exception("sign check fail: parameters is Empty!");
            }

            if (!parameters.TryGetValue(JDPayContants.SIGN, out var sign))
            {
                throw new Exception("sign check fail: sign is Empty!");
            }

            var signContent = JDPaySecurity.GetSignContent(parameters);

            if (!JDPaySecurity.RSACheckContent(signContent, sign, Options.PublicKey))
            {
                throw new Exception("sign check fail: check Sign and Data Fail");
            }
        }
示例#2
0
        private void CheckNotifySign(JDPayDictionary dictionary, JDPayOptions options)
        {
            if (dictionary.Count == 0)
            {
                throw new JDPayException("sign check fail: dictionary is Empty!");
            }

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

            var signContent = JDPaySecurity.GetSignContent(dictionary);

            if (!JDPaySecurity.RSACheckContent(signContent, sign, options.PublicKey))
            {
                throw new JDPayException("sign check fail: check Sign and Data Fail");
            }
        }