# HG changeset patch # User Paul Boddie # Date 1384121181 -3600 # Node ID 920b5fd270f9821d59422eaf78ba89118a6c9e7e # Parent 06bd68b1338c0ca0f34a063bb5fa878eb1ff7f25 Added the exported key part to a message in order to include required metadata. diff -r 06bd68b1338c -r 920b5fd270f9 README.txt --- a/README.txt Sun Nov 10 19:07:54 2013 +0100 +++ b/README.txt Sun Nov 10 23:06:21 2013 +0100 @@ -396,6 +396,24 @@ This should retrieve all messages from the store associated with the "/wiki/ShareTest" resource on localhost. +Exporting and Sending Keys +-------------------------- + +To export a public key, the following command can be used: + +python tests/text_export.py 1C1AAF83 + +This will output a public key block in a MIME message part suitable for +incorporation into a larger message or signing. Signing a message containing +such a key can be done as follows: + + python tests/text_export.py 1C1AAF83 \ +| python tests/test_sign.py 1C1AAF83 + +Obviously, this does not provide any additional reassurance about the nature +of the exported key other than the originator was able to sign it with the +same keypair information. + The Message Format ------------------ diff -r 06bd68b1338c -r 920b5fd270f9 tests/test_export.py --- a/tests/test_export.py Sun Nov 10 19:07:54 2013 +0100 +++ b/tests/test_export.py Sun Nov 10 23:06:21 2013 +0100 @@ -1,16 +1,21 @@ #!/usr/bin/env python -from MoinMessage import GPG +from MoinMessage import GPG, Message import sys if __name__ == "__main__": keyid = sys.argv[1] gpg = GPG() - text = gpg.exportKey(keyid) + key = gpg.exportKey(keyid) + key["Update-Action"] = "store" + + message = Message() + message.add_update(key) # Show the resulting text. + text = message.get_payload() print text # vim: tabstop=4 expandtab shiftwidth=4