aboutsummaryrefslogtreecommitdiffstats
path: root/smime/lib
diff options
context:
space:
mode:
Diffstat (limited to 'smime/lib')
-rw-r--r--smime/lib/e-cert.c18
-rw-r--r--smime/lib/e-cert.h1
2 files changed, 13 insertions, 6 deletions
diff --git a/smime/lib/e-cert.c b/smime/lib/e-cert.c
index 173f445c22..b2f4c71769 100644
--- a/smime/lib/e-cert.c
+++ b/smime/lib/e-cert.c
@@ -313,6 +313,17 @@ e_cert_get_raw_der (ECert *cert, char **data, guint32 *len)
}
const char*
+e_cert_get_window_title (ECert *cert)
+{
+ if (cert->priv->cert->nickname)
+ return cert->priv->cert->nickname;
+ else if (cert->priv->cn)
+ return cert->priv->cn;
+ else
+ return cert->priv->cert->subjectName;
+}
+
+const char*
e_cert_get_nickname (ECert *cert)
{
return cert->priv->cert->nickname;
@@ -1128,12 +1139,7 @@ create_asn1_struct (ECert *cert)
cert->priv->asn1 = e_asn1_object_new ();
- if (cert->priv->cert->nickname)
- e_asn1_object_set_display_name (cert->priv->asn1, cert->priv->cert->nickname);
- else if (cert->priv->cn)
- e_asn1_object_set_display_name (cert->priv->asn1, cert->priv->cn);
- else
- e_asn1_object_set_display_name (cert->priv->asn1, cert->priv->cert->subjectName);
+ e_asn1_object_set_display_name (cert->priv->asn1, e_cert_get_window_title (cert));
/* This sequence will be contain the tbsCertificate, signatureAlgorithm,
and signatureValue. */
diff --git a/smime/lib/e-cert.h b/smime/lib/e-cert.h
index d18e0a9486..243ce1539b 100644
--- a/smime/lib/e-cert.h
+++ b/smime/lib/e-cert.h
@@ -71,6 +71,7 @@ ECert* e_cert_new_from_der (char *data, guint32 len);
CERTCertificate* e_cert_get_internal_cert (ECert *cert);
gboolean e_cert_get_raw_der (ECert *cert, char **data, guint32 *len);
+const char* e_cert_get_window_title (ECert *cert);
const char* e_cert_get_nickname (ECert *cert);
const char* e_cert_get_email (ECert *cert);
const char* e_cert_get_org (ECert *cert);