aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-07-23 00:57:07 +0000
committernils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-07-23 00:57:07 +0000
commit95ba1ee4a1bb5c6d3640565fc5e3cf418abafe51 (patch)
tree350b6cd29b9048d136247a8067269322cb9da23e
parentindependent notifcation area (diff)
downloadgpg4usb-95ba1ee4a1bb5c6d3640565fc5e3cf418abafe51.tar.gz
gpg4usb-95ba1ee4a1bb5c6d3640565fc5e3cf418abafe51.zip
added isCompletelySigned function
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@504 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r--gpgwin.cpp12
-rw-r--r--gpgwin.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/gpgwin.cpp b/gpgwin.cpp
index 74fdadf..843c61f 100644
--- a/gpgwin.cpp
+++ b/gpgwin.cpp
@@ -708,6 +708,16 @@ void GpgWin::sign()
cursor.endEditBlock();
}
}
+bool GpgWin::isCompletedlySigned(const QByteArray &text) {
+
+ if (text.startsWith("-----BEGIN PGP SIGNED MESSAGE-----") && text.endsWith("-----END PGP SIGNATURE-----")) {
+ qDebug() << "totally signed";
+ return true;
+ } else {
+ qDebug("partially signed");
+ return false;
+ }
+}
void GpgWin::verify()
{
@@ -715,6 +725,8 @@ void GpgWin::verify()
QByteArray text = edit->curTextPage()->toPlainText().toAscii(); // TODO: toUtf8() here?
preventNoDataErr(&text);
+ isCompletedlySigned(text);
+
gpgme_signature_t sign = mCtx->verify(text);
if (sign == NULL) {
diff --git a/gpgwin.h b/gpgwin.h
index bb29c1c..ba69088 100644
--- a/gpgwin.h
+++ b/gpgwin.h
@@ -98,6 +98,7 @@ private:
void saveSettings();
void preventNoDataErr(QByteArray *in);
void parseMime(QByteArray *message);
+ bool isCompletedlySigned(const QByteArray &text);
TextEdit *edit;
QMenu *fileMenu;