paul@10 | 1 | #!/usr/bin/env python |
paul@10 | 2 | |
paul@105 | 3 | from MoinMessage import GPG, as_string |
paul@10 | 4 | from email.parser import Parser |
paul@10 | 5 | import sys |
paul@10 | 6 | |
paul@10 | 7 | if __name__ == "__main__": |
paul@10 | 8 | message = Parser().parse(sys.stdin) |
paul@10 | 9 | content, signature = message.get_payload() |
paul@10 | 10 | |
paul@87 | 11 | if len(sys.argv) > 1: |
paul@87 | 12 | gpg = GPG(sys.argv[1]) |
paul@87 | 13 | else: |
paul@87 | 14 | gpg = GPG() |
paul@105 | 15 | print gpg.verifyMessageText(signature.get_payload(decode=True), as_string(content)) |
paul@10 | 16 | |
paul@10 | 17 | # vim: tabstop=4 expandtab shiftwidth=4 |