aboutsummaryrefslogtreecommitdiffstats
path: root/gpgcontext.cpp
diff options
context:
space:
mode:
authorubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2012-08-03 20:38:27 +0000
committerubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2012-08-03 20:38:27 +0000
commita274da36798b7aa7a7cbc9e85ec30748fa66047e (patch)
treeb5f4e5403ecae4a86a28f8e58925c2a2f1e01db0 /gpgcontext.cpp
parentreorganize kgpg source tree (diff)
downloadgpg4usb-a274da36798b7aa7a7cbc9e85ec30748fa66047e.tar.gz
gpg4usb-a274da36798b7aa7a7cbc9e85ec30748fa66047e.zip
start porting encrypt from kgpg, not yet working
git-svn-id: http://cpunk.de/svn/src/gpg4usb/branches/0.3.2-mac@932 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'gpgcontext.cpp')
-rw-r--r--gpgcontext.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/gpgcontext.cpp b/gpgcontext.cpp
index f87ed11..a6dec21 100644
--- a/gpgcontext.cpp
+++ b/gpgcontext.cpp
@@ -24,6 +24,7 @@
#include "kgpg/kgpginterface.h"
#include "kgpg/klinebufferedprocess.h"
#include "kgpg/core/kgpgkey.h"
+#include "kgpg/transactions/kgpgencrypt.h"
#ifdef _WIN32
#include <windows.h>
#include <unistd.h> /* contains read/write */
@@ -274,7 +275,7 @@ void GpgContext::deleteKeys(QStringList *uidList)
bool GpgContext::encrypt(QStringList *uidList, const QByteArray &inBuffer, QByteArray *outBuffer)
{
- gpgme_data_t in = 0, out = 0;
+ /*gpgme_data_t in = 0, out = 0;
outBuffer->resize(0);
if (uidList->count() == 0) {
@@ -285,7 +286,7 @@ bool GpgContext::encrypt(QStringList *uidList, const QByteArray &inBuffer, QByte
//gpgme_encrypt_result_t e_result;
gpgme_key_t recipients[uidList->count()+1];
- /* get key for user */
+ // get key for user
for (int i = 0; i < uidList->count(); i++) {
// the last 0 is for public keys, 1 would return private keys
gpgme_op_keylist_start(mCtx, uidList->at(i).toAscii().constData(), 0);
@@ -312,7 +313,7 @@ bool GpgContext::encrypt(QStringList *uidList, const QByteArray &inBuffer, QByte
}
}
}
- /* unref all keys */
+ // unref all keys
for (int i = 0; i <= uidList->count(); i++) {
gpgme_key_unref(recipients[i]);
}
@@ -322,9 +323,17 @@ bool GpgContext::encrypt(QStringList *uidList, const QByteArray &inBuffer, QByte
if (out) {
gpgme_data_release(out);
}
- return (err == GPG_ERR_NO_ERROR);
+ return (err == GPG_ERR_NO_ERROR);*/
+ QStringList options;
+ KGpgEncrypt::EncryptOptions opts = KGpgEncrypt::DefaultEncryption;
+
+ //KGpgEncrypt *encr = new KGpgEncrypt(this, uidList, toPlainText(), opts, options);
+ //encr->start();
+ //connect(encr, SIGNAL(done(int)), SLOT(slotEncodeUpdate(int)));
}
+
+
/** Decrypt QByteAarray, return QByteArray
* mainly from http://basket.kde.org/ (kgpgme.cpp)
*/