work on tests, disk crypto, pgp
This commit is contained in:
parent
6eae2f4a52
commit
378bcc64d8
2
api.py
2
api.py
@ -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())
|
||||
|
5
core.py
5
core.py
@ -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):
|
||||
|
11
tests.py
11
tests.py
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user