]> git.pld-linux.org Git - projects/pld-builder.new.git/blame - PLD_Builder/gpg.py
- request parser
[projects/pld-builder.new.git] / PLD_Builder / gpg.py
CommitLineData
f12b80ea
MM
1import popen2
2import re
3
4def verify_sig(email):
5 """Check signature.
6
7 Given email as list of strings, return (signer-emails, signed-body).
8 where both are lists of strings.
9 """
10 (gpg_out, gpg_in, gpg_err) = popen2.popen3("LC_ALL=C gpg --decrypt")
11 for l in email:
12 gpg_in.write(l)
13 gpg_in.close()
14 body = gpg_out.readlines()
15 rx = re.compile("^gpg: Good signature from .*<([^>]+)>")
16 emails = []
17 for l in gpg_err.readlines():
18 m = rx.match(l)
19 if m:
20 emails.append(m.group(1))
21 return (emails, body)
This page took 0.028866 seconds and 4 git commands to generate.