收藏
回答

.net版微信支付分支付回调数据如何解密?

1.解密方法己找到。

 public class AesGcm
    {
        private static string ALGORITHM = "AES/GCM/NoPadding";
        private static int TAG_LENGTH_BIT = 128;
        private static int NONCE_LENGTH_BYTE = 12;
        private static string AES_KEY = "qrmmdt198611qrmmdt198611qrmmdt19";
        public static string AesGcmDecrypt(string content, string key, string ivs)
        {
            byte[] bytes = Encoding.UTF8.GetBytes(key);
            byte[] bytes2 = Encoding.UTF8.GetBytes(ivs);
            byte[] array = Convert.FromBase64String(content);
            byte[] bytes3 = Encoding.UTF8.GetBytes("certificate");
            GcmBlockCipher gcmBlockCipher = new GcmBlockCipher(new AesEngine());
            AeadParameters aeadParameters = new AeadParameters(new KeyParameter(bytes), 128, bytes2, bytes3);
            gcmBlockCipher.Init(false, aeadParameters);
            byte[] array2 = new byte[gcmBlockCipher.GetOutputSize(array.Length)];
            int num = gcmBlockCipher.ProcessBytes(array, 0, array.Length, array2, 0);


            gcmBlockCipher.DoFinal(array2, num);


            return Encoding.UTF8.GetString(array2);
        }
    }
   

请问这个方法的3个参数应该如何传值;


回答关注问题邀请回答
收藏

3 个回答

登录 后发表内容
问题标签