TypeError:这不是私钥

Why Am I Getting This Error : raise TypeError("This is not a private key") TypeError: This is not a private key Here My Code Is:

def sign_transaction(self):
    private_key = RSA.importKey(binascii.unhexlify(self.sender_private_key))
    signer = PKCS1_v1_5.new(private_key)
    h = SHA.new(str(self.to_dict()).encode('utf8'))
    return binascii.hexlify(signer.sign(h)).decode('ascii')`
评论