diff options
author | Andre Heinecke <[email protected]> | 2018-06-08 14:19:47 +0000 |
---|---|---|
committer | Andre Heinecke <[email protected]> | 2018-06-08 14:19:47 +0000 |
commit | 8dff414e170e4df8ea661028c4ac1588311ca26e (patch) | |
tree | 31c22ac02ca6ba4bf730f1f2e1d3e4c7f314e2a8 /lang/cpp/src/context.cpp | |
parent | json: Return fingerprint as createkey result (diff) | |
download | gpgme-8dff414e170e4df8ea661028c4ac1588311ca26e.tar.gz gpgme-8dff414e170e4df8ea661028c4ac1588311ca26e.zip |
cpp: Add proper gpgme_op_createkey
* lang/cpp/src/context.cpp, lang/cpp/src/context.h
(Context::createKeyEx): New.
--
The createKeyEx function follows the usual pattern that the
synchronous call returns a result directly while for the
async an extra call is neccessary.
Diffstat (limited to 'lang/cpp/src/context.cpp')
-rw-r--r-- | lang/cpp/src/context.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lang/cpp/src/context.cpp b/lang/cpp/src/context.cpp index 8fde84a5..aab22cdb 100644 --- a/lang/cpp/src/context.cpp +++ b/lang/cpp/src/context.cpp @@ -1436,6 +1436,23 @@ Error Context::createKey (const char *userid, flags)); } +KeyGenerationResult Context::createKeyEx (const char *userid, + const char *algo, + unsigned long reserved, + unsigned long expires, + const Key &certkey, + unsigned int flags) +{ + d->lasterr = gpgme_op_createkey(d->ctx, + userid, + algo, + reserved, + expires, + certkey.impl(), + flags); + return KeyGenerationResult(d->ctx, Error(d->lasterr)); +} + Error Context::addUid(const Key &k, const char *userid) { return Error(d->lasterr = gpgme_op_adduid(d->ctx, |