2014-01-05 | Paul Boddie | raw annotate files changeset graph | Employed content transfer decoding when decrypting message parts. Moved connection initialisation to a separate function and exposed the response from message sending in a separate function. |
1 #!/usr/bin/env python 2 3 from MoinMessage import GPG 4 from email.parser import Parser 5 import sys 6 7 if __name__ == "__main__": 8 message = Parser().parse(sys.stdin) 9 content, signature = message.get_payload() 10 11 if len(sys.argv) > 1: 12 gpg = GPG(sys.argv[1]) 13 else: 14 gpg = GPG() 15 print gpg.verifyMessageText(signature.get_payload(), content.as_string()) 16 17 # vim: tabstop=4 expandtab shiftwidth=4