Commit ff14e0df authored by putro's avatar putro

added nym deletion feature

parent 5df39ef0
......@@ -124,20 +124,36 @@ def createNym():
setActiveNym(email)
msg = prepareSetupMsg(gpgfuncts.selectSecKey(email), subj_type, subject)
print msg
pressKey()
emsg = signCryptMsg(msg, dest, sign=False)
emsg = signCryptMsg(msg, dest, sign=False, passphrase="")
if not emsg:
config['last_message'] = "Something went wrong while preparing the message, recipient key missing ???"
menu()
sendMixMsg(dest, emsg)
def deleteNym():
config['last_message'] = "Function not yet implemented"
#print "Choose nym to delete"
#askNym()
menu()
print "Choose nym to delete"
askNym()
dest = "config@" + anym.domain
if not gpgfuncts.selectKey(dest):
config['last_message'] = "Server %s key not available, abort" % server
menu()
if not gpgfuncts.selectKey(anym.name):
print "no key available, creating a new one for %s" % email
menu()
if not anym['passphrase']:
pwd = askPassphrase()
else:
pwd = anym['passphrase']
msg = prepareSetupMsg(gpgfuncts.selectSecKey(anym.name), "delete", "yes")
emsg = signCryptMsg(msg, dest, sign=anym.fp, passphrase=pwd)
if not emsg:
config['last_message'] = "Something went wrong while preparing the message, recipient key missing ???"
menu()
sendMixMsg(dest, emsg)
def prepareSetupMsg(keyid, subj_type, subject):
......@@ -146,8 +162,8 @@ def prepareSetupMsg(keyid, subj_type, subject):
return msg
def signCryptMsg(msg, dest, sign):
msg = gpgfuncts.encrypt(msg, dest, sign=sign)
def signCryptMsg(msg, dest, sign, passphrase):
msg = gpgfuncts.stripVersion(str(gpgfuncts.encrypt(msg, dest, sign=sign, passphrase=passphrase)))
return msg
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment