Add get_private_key
to Host
This commit is contained in:
parent
a63f00d8f8
commit
e49de15227
|
@ -67,6 +67,9 @@ class BasicHost(IHost):
|
|||
def get_public_key(self) -> PublicKey:
|
||||
return self.peerstore.pubkey(self.get_id())
|
||||
|
||||
def get_private_key(self) -> PublicKey:
|
||||
return self.peerstore.privkey(self.get_id())
|
||||
|
||||
def get_network(self) -> INetwork:
|
||||
"""
|
||||
:return: network instance of host
|
||||
|
|
|
@ -24,6 +24,12 @@ class IHost(ABC):
|
|||
:return: the public key belonging to the peer
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
def get_private_key(self) -> PublicKey:
|
||||
"""
|
||||
:return: the private key belonging to the peer
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
def get_network(self) -> INetwork:
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue
Block a user