1.1 --- a/README.txt Sun Nov 10 19:07:54 2013 +0100
1.2 +++ b/README.txt Sun Nov 10 23:06:21 2013 +0100
1.3 @@ -396,6 +396,24 @@
1.4 This should retrieve all messages from the store associated with the
1.5 "/wiki/ShareTest" resource on localhost.
1.6
1.7 +Exporting and Sending Keys
1.8 +--------------------------
1.9 +
1.10 +To export a public key, the following command can be used:
1.11 +
1.12 +python tests/text_export.py 1C1AAF83
1.13 +
1.14 +This will output a public key block in a MIME message part suitable for
1.15 +incorporation into a larger message or signing. Signing a message containing
1.16 +such a key can be done as follows:
1.17 +
1.18 + python tests/text_export.py 1C1AAF83 \
1.19 +| python tests/test_sign.py 1C1AAF83
1.20 +
1.21 +Obviously, this does not provide any additional reassurance about the nature
1.22 +of the exported key other than the originator was able to sign it with the
1.23 +same keypair information.
1.24 +
1.25 The Message Format
1.26 ------------------
1.27
2.1 --- a/tests/test_export.py Sun Nov 10 19:07:54 2013 +0100
2.2 +++ b/tests/test_export.py Sun Nov 10 23:06:21 2013 +0100
2.3 @@ -1,16 +1,21 @@
2.4 #!/usr/bin/env python
2.5
2.6 -from MoinMessage import GPG
2.7 +from MoinMessage import GPG, Message
2.8 import sys
2.9
2.10 if __name__ == "__main__":
2.11 keyid = sys.argv[1]
2.12
2.13 gpg = GPG()
2.14 - text = gpg.exportKey(keyid)
2.15 + key = gpg.exportKey(keyid)
2.16 + key["Update-Action"] = "store"
2.17 +
2.18 + message = Message()
2.19 + message.add_update(key)
2.20
2.21 # Show the resulting text.
2.22
2.23 + text = message.get_payload()
2.24 print text
2.25
2.26 # vim: tabstop=4 expandtab shiftwidth=4