コード例 #1
0
ファイル: AlipaySignature.cs プロジェクト: nishizhen/payment
        public static bool RSACheckContent(string data, string sign, string publicKey, string signType)
        {
            var key = RSAUtilities.GetRSAParametersFormPublicKey(publicKey);

            switch (signType)
            {
            case "RSA2":
                return(SHA256WithRSA.Verify(data, sign, key));

            default:
                return(SHA1WithRSA.Verify(data, sign, key));
            }
        }
コード例 #2
0
ファイル: AlipaySignature.cs プロジェクト: hueifeng/payment
        public static bool RSACheckContent(string data, string sign, string publicKey, string signType)
        {
            switch (signType)
            {
            case "RSA1":
                return(SHA1WithRSA.Verify(data, sign, publicKey));

            case "RSA2":
                return(SHA256WithRSA.Verify(data, sign, publicKey));

            default:
                return(SHA1WithRSA.Verify(data, sign, publicKey));
            }
        }