minibear2021 / wechatpayv3

微信支付 API v3 Python SDK
MIT License
932 stars 141 forks source link

ValueError: AESGCM key must be 128, 192, or 256 bits. #59

Closed myccy123 closed 3 weeks ago

myccy123 commented 1 month ago
wxpay = WeChatPay(
        ^^^^^^^^^^

File "/root/coupon/venv/lib/python3.11/site-packages/wechatpayv3/init.py", line 40, in init self._core = Core(mchid=self._mchid, ^^^^^^^^^^^^^^^^^^^^^^^ File "/root/coupon/venv/lib/python3.11/site-packages/wechatpayv3/core.py", line 27, in init self._init_certificates() File "/root/coupon/venv/lib/python3.11/site-packages/wechatpayv3/core.py", line 218, in _init_certificates self._update_certificates() File "/root/coupon/venv/lib/python3.11/site-packages/wechatpayv3/core.py", line 50, in _update_certificates cert_str = aes_decrypt( ^^^^^^^^^^^^ File "/root/coupon/venv/lib/python3.11/site-packages/wechatpayv3/utils.py", line 47, in aes_decrypt aesgcm = AESGCM(key=key_bytes) ^^^^^^^^^^^^^^^^^^^^^ ValueError: AESGCM key must be 128, 192, or 256 bits.

这个是apiv3的密钥不对,还是证书私钥不对啊?

minibear2021 commented 1 month ago

apiv3 key

myccy123 commented 1 month ago

是用生成时填的那个32位的, 还是生成出来的那个40位的?

minibear2021 commented 3 weeks ago

32位的