PyCryptoDome ECDSA:“ AttributeError:'bytes'对象没有属性'oid'”是什么意思?

时间:2020-09-12 23:34:40

标签: python-3.x signature pycrypto ecdsa pycryptodome

我对这个错误的含义甚至有疑问:“ AttributeError:'bytes'对象没有属性'oid'”。我不是使用私钥,而是使用公钥对消息签名以创建签名来测试API登录。我不能使用私钥,因为没有给我一个。有谁知道这意味着什么,我该如何解决这个错误?

server_salt = serversalt(user_id)
client_salt = "random sequence of numbers"
message = base64.b64encode(user_id.encode("utf-8"))+ server_salt
key = Ecc.generate(curve="primve256v1")
key = key.public_key().export_key(format="DER")
public_key = ECC.import(key)
signer = DSS.new(public_kay, "fips-186-3")
signature = signer.sign(message)
print(signature)

响应:AttributeError:'bytes'对象没有属性'oid'

0 个答案:

没有答案