Exemplo n.º 1
0
        public void should_pass_rsa_cert_check_v1_when_sign_is_self_generated_and_load_key_from_file()
        {
            //gien
            Dictionary <string, string> parameters = new Dictionary <string, string>
            {
                { "测试Key1", "测试Value1" },
                { "测试Key2", "测试Value2" }
            };

            parameters.Add("sign", AlipaySignature.Sign(parameters, TestAccount.Mock.AppPrivateKeyFile, "UTF-8", "RSA2", true));
            parameters.Add("sign_type", "RSA2");

            //when
            bool result = AlipaySignature.VerifyV1(parameters, TestAccount.Mock.AppPublicKeyFile, "UTF-8", "RSA2", true);

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