aboutsummaryrefslogtreecommitdiffstats
path: root/context.cpp
diff options
context:
space:
mode:
authornils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-10-11 20:34:55 +0000
committernils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-10-11 20:34:55 +0000
commit5af560a0ef23b5a1d134f65e135e5c7f4bc1a84c (patch)
tree748f719a627d5e2a0dea167b4c25758e47f73b0e /context.cpp
parentmoved preventnodataerr to context.cpp, added refresh slots for verify (diff)
downloadgpg4usb-5af560a0ef23b5a1d134f65e135e5c7f4bc1a84c.tar.gz
gpg4usb-5af560a0ef23b5a1d134f65e135e5c7f4bc1a84c.zip
moved textissigned to context
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@545 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to '')
-rw-r--r--context.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/context.cpp b/context.cpp
index 87b6c3f..d7a17a1 100644
--- a/context.cpp
+++ b/context.cpp
@@ -633,6 +633,22 @@ void Context::preventNoDataErr(QByteArray *in)
}
}
+/*
+ * isSigned returns:
+ * - 0, if text isn't signed at all
+ * - 1, if text is partially signed
+ * - 2, if text is completly signed
+ */
+int Context::textIsSigned(const QByteArray &text) {
+ if (text.trimmed().startsWith("-----BEGIN PGP SIGNED MESSAGE-----") && text.trimmed().endsWith("-----END PGP SIGNATURE-----")) {
+ return 2;
+ }
+ if (text.contains("-----BEGIN PGP SIGNED MESSAGE-----") && text.contains("-----END PGP SIGNATURE-----")) {
+ return 1;
+ }
+ return 0;
+}
+
}