diff options
Diffstat (limited to 'context.cpp')
-rw-r--r-- | context.cpp | 8 |
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*/ |