aboutsummaryrefslogtreecommitdiffstats
path: root/context.cpp
diff options
context:
space:
mode:
authornils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-10-17 20:59:26 +0000
committernils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-10-17 20:59:26 +0000
commit88e8f0dfc2a14458d4ede27b1c011d059a342f26 (patch)
treed33f20d9e060987c460fd6e28526ef04ae341801 /context.cpp
parentupdated german translation (diff)
downloadgpg4usb-88e8f0dfc2a14458d4ede27b1c011d059a342f26.tar.gz
gpg4usb-88e8f0dfc2a14458d4ede27b1c011d059a342f26.zip
also export public key on private key export, but error handling still needs to be made
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@555 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'context.cpp')
-rw-r--r--context.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/context.cpp b/context.cpp
index 812c529..e3ee119 100644
--- a/context.cpp
+++ b/context.cpp
@@ -472,10 +472,18 @@ int Context::checkErr(gpgme_error_t err) const
void Context::exportSecretKey(QString uid, QByteArray *outBuffer)
{
+ // export private key to outBuffer
QStringList arguments;
arguments << "--armor" << "--export-secret-key" << uid;
QByteArray *err = new QByteArray();
executeGpgCommand(arguments, outBuffer, err);
+
+ // append public key to outBuffer
+ QByteArray *pubKey = new QByteArray();
+ QStringList keyList;
+ keyList.append(uid);
+ exportKeys(&keyList,pubKey);
+ outBuffer->append(*pubKey);
}
/** return type should be gpgme_error_t*/