From 15fbac9e72a4d1bff9a3b9e9822f9175b09fbcd5 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Fri, 17 Feb 2017 17:07:05 +0100 Subject: python: Support manipulating the TOFU policy. * NEWS: Update. * doc/gpgme.texi: Fix typos. * lang/python/gpg/constants/__init__.py: Import new files. * lang/python/gpg/constants/tofu/__init__.py: New file. * lang/python/gpg/constants/tofu/policy.py: New file. * lang/python/gpg/core.py (Context.key_tofu_policy): New function. * lang/python/gpgme.i: Nice reprs for gpgme_tofu_info_t. * lang/python/setup.py.in: Install new package. * lang/python/tests/t-quick-key-manipulation.py: Extend test. Signed-off-by: Justus Winter --- lang/python/gpg/core.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lang/python/gpg/core.py') diff --git a/lang/python/gpg/core.py b/lang/python/gpg/core.py index cb4ccf73..fe0ba81c 100644 --- a/lang/python/gpg/core.py +++ b/lang/python/gpg/core.py @@ -716,6 +716,18 @@ class Context(GpgmeWrapper): self.op_keysign(key, uids, expires_in, flags) + def key_tofu_policy(self, key, policy): + """Set a keys' TOFU policy + + Set the TOFU policy associated with KEY to POLICY. Calling + this function is only valid for the OpenPGP protocol. + + Raises: + GPGMEError -- as signaled by the underlying library + + """ + self.op_tofu_policy(key, policy) + def assuan_transact(self, command, data_cb=None, inquire_cb=None, status_cb=None): """Issue a raw assuan command -- cgit v1.2.3