如果我将字节放入private_bytes()中,它只允许Ed25519PrivateKey.generate()而不允许任何其他字节
from cryptography.hazmat.primitives._serialization import NoEncryption, PrivateFormat, PublicFormat
privkey = os.urandom(32)
privkey_raw = privatekey_raw = privkey.private_bytes(
Encoding.Raw,
PrivateFormat.Raw,
NoEncryption()
)
如果我执行这个,结果就是这样
AttributeError: 'bytes' object has no attribute 'private_bytes'
目前没有回答
相关问题 更多 >
编程相关推荐