show owner trust in full info
[claws.git] / src / plugins / pgpcore / sgpgme.c
index b95ad7a..e6b7acb 100644 (file)
@@ -153,6 +153,22 @@ static const gchar *get_validity_str(unsigned long validity)
        }
 }
 
+static const gchar *get_owner_trust_str(unsigned long owner_trust)
+{
+       switch (gpgme_err_code(owner_trust)) {
+       case GPGME_VALIDITY_NEVER:
+               return _("Untrusted");
+       case GPGME_VALIDITY_MARGINAL:
+               return _("Marginal");
+       case GPGME_VALIDITY_FULL:
+               return _("Full");
+       case GPGME_VALIDITY_ULTIMATE:
+               return _("Ultimate");
+       default:
+               return _("Unknown");
+       }
+}
+
 static gchar *extract_name(const char *uid)
 {
        if (uid == NULL)
@@ -330,6 +346,8 @@ gchar *sgpgme_sigstat_info_full(gpgme_ctx_t ctx, gpgme_verify_result_t status)
                                j++;
                                user = user->next;
                        }
+                       g_string_append_printf(siginfo,_("Owner Trust: %s\n"),
+                                              get_owner_trust_str(key->owner_trust));
                        g_string_append(siginfo,
                                _("Primary key fingerprint:"));
                        const char* primary_fpr = NULL;