mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Refactor ID to not use third-party type for cryptographic keys
Remove `ID.from_privkey` which would require specific knowledge per cryptosystem
This commit is contained in:
@ -28,9 +28,8 @@ async def cleanup_done_tasks():
|
||||
|
||||
|
||||
def generate_id():
|
||||
new_key = RSA.generate(2048, e=65537)
|
||||
new_id = ID.from_pubkey(new_key.publickey())
|
||||
# private_key = new_key.exportKey("PEM")
|
||||
new_key = RSA.generate(2048, e=65537).publickey().export_key("DER")
|
||||
new_id = ID.from_pubkey(new_key)
|
||||
return new_id
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user