comparison bnpparibas.py @ 10:636ea715af1e

Switch to GnuPG v2
author Daniele Nicolodi <daniele@grinta.net>
date Mon, 11 Jan 2016 19:45:30 +0100
parents 225885e803b4
children f3d6d73a7184
comparison
equal deleted inserted replaced
9:225885e803b4 10:636ea715af1e
104 self.homedir = homedir 104 self.homedir = homedir
105 105
106 def encrypt(self, message, sender, recipient): 106 def encrypt(self, message, sender, recipient):
107 sender = parseaddr(sender)[1] 107 sender = parseaddr(sender)[1]
108 recipient = parseaddr(recipient)[1] 108 recipient = parseaddr(recipient)[1]
109 cmd = [ "gpg", "--homedir", self.homedir, "--sign", "--encrypt", 109 cmd = [ "gpg2", "--homedir", self.homedir, "--sign", "--encrypt",
110 "--batch", "--no-options", "--yes", "--armor", 110 "--batch", "--no-options", "--yes", "--armor",
111 "--local-user", sender, "--recipient", recipient, ] 111 "--local-user", sender, "--recipient", recipient, ]
112 p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) 112 p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
113 encdata, err = p.communicate(input=message.encode('utf-8')) 113 encdata, err = p.communicate(input=message.encode('utf-8'))
114 if p.returncode: 114 if p.returncode: