aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpg/result_analyse/SignResultAnalyse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpg/result_analyse/SignResultAnalyse.cpp')
-rw-r--r--src/gpg/result_analyse/SignResultAnalyse.cpp47
1 files changed, 45 insertions, 2 deletions
diff --git a/src/gpg/result_analyse/SignResultAnalyse.cpp b/src/gpg/result_analyse/SignResultAnalyse.cpp
index 51ab5a46..9ef9dfec 100644
--- a/src/gpg/result_analyse/SignResultAnalyse.cpp
+++ b/src/gpg/result_analyse/SignResultAnalyse.cpp
@@ -24,12 +24,55 @@
#include "gpg/result_analyse/SignResultAnalyse.h"
-SignResultAnalyse::SignResultAnalyse(gpgme_sign_result_t result) {
- stream << "Sign Report: " << Qt::endl;
+SignResultAnalyse::SignResultAnalyse(gpgme_error_t error, gpgme_sign_result_t result) {
+
+ if(result == nullptr) {
+ return;
+ }
+
+ stream << "# Sign Report: " << endl
+ << "-----" << endl;
+ stream << "Status: " << gpgme_strerror(error) << endl << endl;
auto new_sign = result->signatures;
while(new_sign != nullptr) {
+ stream << "> A New Signature: " << endl;
+
+ stream << "Sign mode: ";
+ if(new_sign->type & GPGME_SIG_MODE_NORMAL)
+ stream << "Normal";
+ else if(new_sign->type & GPGME_SIG_MODE_CLEAR)
+ stream << "Clear";
+ else if(new_sign->type & GPGME_SIG_MODE_DETACH)
+ stream << "Detach";
+
+ stream << endl;
+
+ stream << "Public key algo: " << gpgme_pubkey_algo_name(new_sign->pubkey_algo) << endl;
+ stream << "Hash algo: " << gpgme_hash_algo_name(new_sign->hash_algo) << endl;
+ stream << "Date of signature: " << QDateTime::fromTime_t(new_sign->timestamp).toString() << endl;
+
+ stream << endl;
+ new_sign = new_sign->next;
}
+
+ auto invalid_signer = result->invalid_signers;
+
+ if(invalid_signer!= nullptr)
+ stream << "Invalid Signers: " << endl;
+
+ while(invalid_signer != nullptr) {
+ setStatus(0);
+ stream << "Fingerprint: " << invalid_signer->fpr << endl;
+ stream << "Reason: " << gpgme_strerror(invalid_signer->reason) << endl;
+ stream << endl;
+
+ invalid_signer = invalid_signer->next;
+ }
+
+ stream << "-----" << endl;
+ stream << endl;
+
}