我正在和我们的客户服务器通信。对于api,我需要用私钥对字符串签名。他们有以下条件要遵循
我在跟踪
from Crypto.Signature import PKCS1_v1_5
from Crypto.Hash import SHA256
from Crypto.PublicKey import RSA
import base64
pkey = RSA.importKey(keystring)
message = "Hello world"
h = SHA256.new(message.encode())
signature = PKCS1_v1_5.new(pkey).sign(h)
result = base64.b64encode(signature).decode()
这里我得到一个字符串作为结果。但在服务器端,我的签名不匹配。你知道吗
我有什么问题吗??有人能帮我吗?你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐