work on tests, disk crypto, pgp

master
Kevin Froman 2018-01-06 02:51:26 -06:00
parent 6eae2f4a52
commit 378bcc64d8
No known key found for this signature in database
GPG Key ID: 0D414D0FE405B63B
3 changed files with 17 additions and 1 deletions

2
api.py
View File

@ -76,8 +76,8 @@ class API:
resp = Response('something')
elif action == 'init':
# generate PGP key
self._core.generateMainPGP()
pass
else:
resp = Response('(O_o) Dude what? (invalid command)')
endTime = math.floor(time.time())

View File

@ -23,6 +23,11 @@ class Core:
def generateMainPGP(self):
# Generate main pgp key
gpg = gnupg.GPG(gnupghome='data/pgp/')
input_data = gpg.gen_key_input(key_type="RSA", key_length=2048, name_real='anon', name_comment='Onionr key', name_email='anon@onionr')
key = gpg.gen_key(input_data)
return
def dataDirEncrypt(self):
return
def daemonQueue(self):

View File

@ -32,6 +32,17 @@ class OnionrTests(unittest.TestCase):
self.assertTrue(False)
else:
self.assertTrue(True)
def testPGPGen(self):
print('--------------------------')
print('Testing PGP key generation')
if os.path.exists('data/pgp/'):
self.assertTrue(False)
else:
import core
myCore = core.Core()
myCore.generateMainPGP()
if os.path.exists('data/pgp/'):
self.assertTrue(True)
def testQueue(self):
print('--------------------------')
print('running daemon queue test')