work on tests, disk crypto, pgp

This commit is contained in:
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') resp = Response('something')
elif action == 'init': elif action == 'init':
# generate PGP key # generate PGP key
self._core.generateMainPGP()
pass pass
else: else:
resp = Response('(O_o) Dude what? (invalid command)') resp = Response('(O_o) Dude what? (invalid command)')
endTime = math.floor(time.time()) endTime = math.floor(time.time())

View File

@ -23,6 +23,11 @@ class Core:
def generateMainPGP(self): def generateMainPGP(self):
# Generate main pgp key # Generate main pgp key
gpg = gnupg.GPG(gnupghome='data/pgp/') 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 return
def daemonQueue(self): def daemonQueue(self):

View File

@ -32,6 +32,17 @@ class OnionrTests(unittest.TestCase):
self.assertTrue(False) self.assertTrue(False)
else: else:
self.assertTrue(True) 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): def testQueue(self):
print('--------------------------') print('--------------------------')
print('running daemon queue test') print('running daemon queue test')