diff options
Diffstat (limited to '')
-rw-r--r-- | src/gpg/GpgContext.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gpg/GpgContext.cpp b/src/gpg/GpgContext.cpp index 17347a57..b72eda73 100644 --- a/src/gpg/GpgContext.cpp +++ b/src/gpg/GpgContext.cpp @@ -968,6 +968,20 @@ namespace GpgME { } } + bool GpgContext::addUID(const GpgKey &key, const UID &uid) { + QString userid = QString("%1 (%3) <%2>").arg(uid.name, uid.email, uid.comment); + auto gpgmeError = gpgme_op_adduid(mCtx, key.key_refer, userid.toUtf8().constData(), 0); + if(gpgmeError == GPG_ERR_NO_ERROR) { + emit signalKeyUpdated(key.id); + return true; + } + else { + checkErr(gpgmeError); + return false; + } + + } + } |