摘要: 直接上代码 url = "https://api.mch.weixin.qq.com/v3/certificates" nonce_str = get_nonce_str(32) #生成32位随机数 timestamp = str(int(time.time())) #时间戳 #生成签名,详细查看( 阅读全文
posted @ 2021-03-17 11:32 做个笔记 阅读(592) 评论(0) 推荐(0) 编辑
摘要: 签名串一共有五行,每一行为一个参数。行尾以 \n结束,包括最后一行。如果参数本身以\n结束,也需要附加一个\n。 HTTP请求方法\n URL\n 时间戳\n 随机字符串\n 请求报文主体\n def sign_str(method, url, timestamp, nonce_str, body) 阅读全文
posted @ 2021-03-17 11:17 做个笔记 阅读(289) 评论(0) 推荐(0) 编辑
摘要: from cryptography.hazmat.primitives.ciphers.aead import AESGCM import base64 def decrypt(nonce, ciphertext, associated_data): key = "Your32Apiv3Key" k 阅读全文
posted @ 2021-03-17 11:14 做个笔记 阅读(4841) 评论(0) 推荐(0) 编辑