mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Convert from base58/pubkey/privkey to class method
This commit is contained in:
@ -4,7 +4,7 @@ from Crypto.PublicKey import RSA
|
||||
|
||||
from .security.insecure_security import InsecureTransport
|
||||
from .peer.peerstore import PeerStore
|
||||
from .peer.id import id_from_public_key
|
||||
from .peer.id import ID
|
||||
from .network.swarm import Swarm
|
||||
from .host.basic_host import BasicHost
|
||||
from .transport.upgrader import TransportUpgrader
|
||||
@ -29,7 +29,7 @@ async def cleanup_done_tasks():
|
||||
|
||||
def generate_id():
|
||||
new_key = RSA.generate(2048, e=65537)
|
||||
new_id = id_from_public_key(new_key.publickey())
|
||||
new_id = ID.from_pubkey(new_key.publickey())
|
||||
# private_key = new_key.exportKey("PEM")
|
||||
return new_id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user