aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/gpg/core.py
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2017-02-17 16:07:05 +0000
committerJustus Winter <[email protected]>2017-02-17 16:08:03 +0000
commit15fbac9e72a4d1bff9a3b9e9822f9175b09fbcd5 (patch)
treecee4dfffa19f9ad95b51afb3e33b73d2b69fa9da /lang/python/gpg/core.py
parentpython: Support quick key signing. (diff)
downloadgpgme-15fbac9e72a4d1bff9a3b9e9822f9175b09fbcd5.tar.gz
gpgme-15fbac9e72a4d1bff9a3b9e9822f9175b09fbcd5.zip
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 <[email protected]>
Diffstat (limited to 'lang/python/gpg/core.py')
-rw-r--r--lang/python/gpg/core.py12
1 files changed, 12 insertions, 0 deletions
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