api now returns pgp keys

This commit is contained in:
Kevin Froman 2018-01-20 03:22:07 -06:00
parent 6a1a448eab
commit 0042e2fe51
No known key found for this signature in database
GPG Key ID: 0D414D0FE405B63B
1 changed files with 3 additions and 1 deletions

View File

@ -23,6 +23,7 @@ from multiprocessing import Process
import configparser, sys, random, threading, hmac, hashlib, base64, time, math, gnupg, os import configparser, sys, random, threading, hmac, hashlib, base64, time, math, gnupg, os
from core import Core from core import Core
import onionrutils
class API: class API:
''' Main http api (flask)''' ''' Main http api (flask)'''
def validateToken(self, token): def validateToken(self, token):
@ -49,6 +50,7 @@ class API:
self.debug = debug self.debug = debug
self._privateDelayTime = 3 self._privateDelayTime = 3
self._core = Core() self._core = Core()
self._utils = onionrutils.OnionrUtils()
app = flask.Flask(__name__) app = flask.Flask(__name__)
bindPort = int(self.config['CLIENT']['PORT']) bindPort = int(self.config['CLIENT']['PORT'])
self.bindPort = bindPort self.bindPort = bindPort
@ -126,7 +128,7 @@ class API:
elif action == 'setHMAC': elif action == 'setHMAC':
pass pass
elif action == 'getPGP': elif action == 'getPGP':
ascii_armored_public_keys = gpg.export_keys('') resp = Response(self._utils.exportMyPubkey())
return resp return resp