Commit ff14e0df authored by putro's avatar putro

added nym deletion feature

parent 5df39ef0
...@@ -124,20 +124,36 @@ def createNym(): ...@@ -124,20 +124,36 @@ def createNym():
setActiveNym(email) setActiveNym(email)
msg = prepareSetupMsg(gpgfuncts.selectSecKey(email), subj_type, subject) msg = prepareSetupMsg(gpgfuncts.selectSecKey(email), subj_type, subject)
print msg emsg = signCryptMsg(msg, dest, sign=False, passphrase="")
pressKey()
emsg = signCryptMsg(msg, dest, sign=False)
if not emsg: if not emsg:
config['last_message'] = "Something went wrong while preparing the message, recipient key missing ???" config['last_message'] = "Something went wrong while preparing the message, recipient key missing ???"
menu() menu()
sendMixMsg(dest, emsg) sendMixMsg(dest, emsg)
def deleteNym(): def deleteNym():
config['last_message'] = "Function not yet implemented" print "Choose nym to delete"
#print "Choose nym to delete" askNym()
#askNym() dest = "config@" + anym.domain
menu()
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): def prepareSetupMsg(keyid, subj_type, subject):
...@@ -146,8 +162,8 @@ def prepareSetupMsg(keyid, subj_type, subject): ...@@ -146,8 +162,8 @@ def prepareSetupMsg(keyid, subj_type, subject):
return msg return msg
def signCryptMsg(msg, dest, sign): def signCryptMsg(msg, dest, sign, passphrase):
msg = gpgfuncts.encrypt(msg, dest, sign=sign) msg = gpgfuncts.stripVersion(str(gpgfuncts.encrypt(msg, dest, sign=sign, passphrase=passphrase)))
return msg 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