Пример #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);
        }
Пример #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);
        }
Пример #3
0
    {    /// AOP系统工具类。
        /// </summary>


        /// <summary>m>
        /// <param name="bizContent"></param>
        /// <param name="charset"></param>
        ///  AES加密
        /// </summary>
        /// <param name="encryptKey"></para
        /// <returns></returns>
        public static string AesEncrypt(string encryptKey, string bizContent, string charset)
        {
            return(AlipayEncrypt.AesEncrypt(encryptKey, bizContent, charset));
        }