示例#1
0
        public void should_pass_rsa_cert_check_v1_when_sign_is_self_generated()
        {
            //gien
            Dictionary <string, string> parameters = new Dictionary <string, string>
            {
                { "测试Key1", "测试Value1" },
                { "测试Key2", "测试Value2" }
            };

            parameters.Add("sign", AlipaySignature.Sign(parameters, TestAccount.ProdCert.AppPrivateKey, "UTF-8", "RSA2", false));
            parameters.Add("sign_type", "RSA2");

            //when
            bool result = AlipaySignature.CertVerifyV1(parameters, TestAccount.ProdCert.CertParams.AppCertPath, "UTF-8", "RSA2");

            //then
            Assert.AreEqual(result, true);
        }