From 7641b7b5f2c9d5b38c60cd9326bcb4810c37dae5 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Thu, 16 Feb 2017 17:52:49 +0100 Subject: 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 --- lang/python/gpg/core.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'lang/python/gpg/core.py') 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 -- cgit v1.2.3