+const char *
+g_mime_certificate_get_valid_userid (GMimeCertificate *cert)
+{
+ /* output user id only if validity is FULL or ULTIMATE. */
+ const char *uid = g_mime_certificate_get_user_id (cert);
+ if (uid == NULL)
+ return uid;
+ GMimeValidity validity = g_mime_certificate_get_id_validity (cert);
+ if (validity == GMIME_VALIDITY_FULL || validity == GMIME_VALIDITY_ULTIMATE)
+ return uid;
+ return NULL;
+}
+
+const char*
+g_mime_certificate_get_fpr16 (GMimeCertificate *cert) {
+ const char *fpr = g_mime_certificate_get_fingerprint (cert);
+ if (!fpr || strlen (fpr) < 16)
+ return fpr;
+
+ return fpr + (strlen (fpr) - 16);
+}
+