Ejemplo n.º 1
0
        public string EncryptSourceData(IAopRequest <T> request, string body, string encryptType, string encryptKey, string charset)
        {
            EncryptParseItem item = ParseEncryptData(request, body);

            string bodyIndexContent = body.Substring(0, item.startIndex);
            string bodyEndContent   = body.Substring(item.endIndex);
            string encryptContent   = AlipayEncrypt.AesDencrypt(encryptKey, item.encryptContent, charset);

            return(bodyIndexContent + encryptContent + bodyEndContent);
        }
Ejemplo n.º 2
0
        public string EncryptSourceData(IAopRequest <T> request, string body, string encryptType, string encryptKey, string charset)
        {
            if (!"AES".Equals(encryptType))
            {
                throw new AopException("API only support AES!");
            }

            EncryptParseItem item = parseEncryptData(request, body);

            string bodyIndexContent = body.Substring(0, item.startIndex);
            string bodyEndexContent = body.Substring(item.endIndex);

            //TODO 解密逻辑
            string bizContent = AlipayEncrypt.AesDencrypt(encryptKey, item.encryptContent, charset);

            return(bodyIndexContent + bizContent + bodyEndexContent);
        }