|
|
|
@ -36,13 +36,13 @@ class GNUnetRest:
|
|
|
|
|
|
|
|
|
|
def fetch_identity_keyhash(self, identity_name):
|
|
|
|
|
"""Returns the hash of the public key of an identity by name."""
|
|
|
|
|
r = requests.get(self.identity_hash + identity_name)
|
|
|
|
|
return r.json()['name'] if r.ok else (False, r.reason)
|
|
|
|
|
r = requests.get(self.identity_name + identity_name)
|
|
|
|
|
return r.json()['pubkey'] if r.ok else (False, r.reason)
|
|
|
|
|
|
|
|
|
|
def fetch_identity_name(self, key_hash):
|
|
|
|
|
"""Returns the name of an identity specified by public key."""
|
|
|
|
|
r = requests.get(self.identity_name + key_hash)
|
|
|
|
|
return r.json()['pubkey'] if r.ok else (False, r.reason)
|
|
|
|
|
"""Returns the name of an identity specified by the key hash."""
|
|
|
|
|
r = requests.get(self.identity_hash + key_hash)
|
|
|
|
|
return r.json()['name'] if r.ok else (False, r.reason)
|
|
|
|
|
|
|
|
|
|
def fetch_namestore_default_identity(self):
|
|
|
|
|
"""Returns the default identity of subsystem 'namestore'."""
|
|
|
|
|