aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/gpg/core.py
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2017-02-16 16:52:49 +0000
committerJustus Winter <[email protected]>2017-02-16 16:55:16 +0000
commit7641b7b5f2c9d5b38c60cd9326bcb4810c37dae5 (patch)
tree989e65b348f7a6f48a90e5be7c51ffd349a6c107 /lang/python/gpg/core.py
parentpython: Support quick subkey creation. (diff)
downloadgpgme-7641b7b5f2c9d5b38c60cd9326bcb4810c37dae5.tar.gz
gpgme-7641b7b5f2c9d5b38c60cd9326bcb4810c37dae5.zip
python: Support adding and revoking UIDs.
* NEWS: Update. * lang/python/gpg/core.py (Context.key_add_uid): New function. (Context.key_revoke_uid): Likewise. * lang/python/tests/Makefile.am (XTESTS): Add new test. * lang/python/tests/t-quick-key-manipulation.py: New file. Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'lang/python/gpg/core.py')
-rw-r--r--lang/python/gpg/core.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/lang/python/gpg/core.py b/lang/python/gpg/core.py
index 2a4df99b..beaebda2 100644
--- a/lang/python/gpg/core.py
+++ b/lang/python/gpg/core.py
@@ -651,6 +651,30 @@ class Context(GpgmeWrapper):
return self.op_genkey_result()
+ def key_add_uid(self, key, uid):
+ """Add a UID
+
+ Add the uid UID to the given KEY. Calling this function is
+ only valid for the OpenPGP protocol.
+
+ Raises:
+ GPGMEError -- as signaled by the underlying library
+
+ """
+ self.op_adduid(key, uid, 0)
+
+ def key_revoke_uid(self, key, uid):
+ """Revoke a UID
+
+ Revoke the uid UID from the given KEY. Calling this function
+ is only valid for the OpenPGP protocol.
+
+ Raises:
+ GPGMEError -- as signaled by the underlying library
+
+ """
+ self.op_revuid(key, uid, 0)
+
def assuan_transact(self, command,
data_cb=None, inquire_cb=None, status_cb=None):
"""Issue a raw assuan command