如果我将字节放入 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'