From 3210f3e4725afc5ee2810b9a1361918ec9c42ca4 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 14 Sep 2016 11:40:34 +0200 Subject: core: New function gpgme_op_adduid. * src/genkey.c: Replace most error codes GPG_ERR_INV_VALUE by GPG_ERR_INV_ARG. (struct op_data_t): Add field UIDMODE. (genkey_status_handler): Use UIDMODE. (adduid_start): New. (gpgme_op_adduid_start, gpgme_op_adduid): New. * src/gpgme.def, src/libgpgme.vers: Add them. * tests/run-genkey.c: Add option --adduid. Signed-off-by: Werner Koch --- src/gpgme.h.in | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/gpgme.h.in') diff --git a/src/gpgme.h.in b/src/gpgme.h.in index 0fdc9276..ec436c80 100644 --- a/src/gpgme.h.in +++ b/src/gpgme.h.in @@ -1835,8 +1835,11 @@ struct _gpgme_op_genkey_result /* A sub key was generated. */ unsigned int sub : 1; + /* A user id was generated. */ + unsigned int uid : 1; + /* Internal to GPGME, do not use. */ - unsigned int _unused : 30; + unsigned int _unused : 29; /* The fingerprint of the generated key. */ char *fpr; @@ -1888,6 +1891,14 @@ gpgme_error_t gpgme_op_createsubkey (gpgme_ctx_t ctx, unsigned long expires, unsigned int flags); +/* Add USERID to an existing KEY. */ +gpgme_error_t gpgme_op_adduid_start (gpgme_ctx_t ctx, + gpgme_key_t key, const char *userid, + unsigned int flags); +gpgme_error_t gpgme_op_adduid (gpgme_ctx_t ctx, + gpgme_key_t key, const char *userid, + unsigned int flags); + /* Retrieve a pointer to the result of a genkey, createkey, or -- cgit v1.2.3