From 865aaaed3fd163ba4c347a08f34780933bcda949 Mon Sep 17 00:00:00 2001 From: ubbo Date: Tue, 7 Aug 2012 10:45:21 +0000 Subject: fix secret key export git-svn-id: http://cpunk.de/svn/src/gpg4usb/branches/0.3.2-mac@944 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- gpgcontext.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'gpgcontext.cpp') diff --git a/gpgcontext.cpp b/gpgcontext.cpp index 677c2c5..2d98372 100644 --- a/gpgcontext.cpp +++ b/gpgcontext.cpp @@ -197,18 +197,21 @@ bool GpgContext::exportKeys(QStringList *uidList, QByteArray *outBuffer) KgpgCore::KgpgKey GpgContext::getKeyDetails(QString uid) { - //KgpgCore::KgpgKey key; + // try secret - /*qDebug() << "blubb"; - KgpgCore::KgpgKey key = KgpgInterface::readSecretKeys(QStringList() << uid).first(); + KgpgCore::KgpgKeyList keys = KgpgInterface::readSecretKeys(QStringList() << uid); + if(keys.empty()) { + // ok try public + keys = KgpgInterface::readPublicKeys(QStringList() << uid); + // that should not happen + /*if(keys.empty()) { + qDebug() << "error, no key with uid" << uid; + return ; + }*/ - qDebug() << "bla"; - qDebug() << "id: " << key.id(); + } - // ok, its a public key - if (key.id() == "") {*/ - KgpgCore::KgpgKey key = KgpgInterface::readPublicKeys(QStringList() << uid).first(); - //} + KgpgCore::KgpgKey key = keys.first(); return key; } -- cgit v1.2.3