1
我想用RSA私鑰簽名的簽名,並與SHA-256 但即時編碼它總是有這種錯誤Python的RSA私有密鑰簽名錯誤
TypeError: Unicode-objects must be encoded before hashing
這裏是代碼片段:
private_key = rsa.PrivateKey.load_pkcs1(open('private.pem', 'rb').read())
signature = rsa.sign(sign, private_key, 'SHA-256')
你能幫我嗎?