changeset 19080:3bdede51c007

- Expose get_unique_id and get_issuer_unique_id through libpurple functions
author William Ehlhardt <williamehlhardt@gmail.com>
date Tue, 07 Aug 2007 23:26:54 +0000
parents 05ae340c42cc
children bdd8911d5031
files libpurple/certificate.c libpurple/certificate.h
diffstat 2 files changed, 38 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/certificate.c	Tue Aug 07 20:29:35 2007 +0000
+++ b/libpurple/certificate.c	Tue Aug 07 23:26:54 2007 +0000
@@ -245,6 +245,26 @@
 }
 
 gchar *
+purple_certificate_get_unique_id(PurpleCertificate *crt)
+{
+	g_return_val_if_fail(crt, NULL);
+	g_return_val_if_fail(crt->scheme, NULL);
+	g_return_val_if_fail(crt->scheme->get_unique_id, NULL);
+
+	return (crt->scheme->get_unique_id)(crt);
+}
+
+gchar *
+purple_certificate_get_issuer_unique_id(PurpleCertificate *crt)
+{
+	g_return_val_if_fail(crt, NULL);
+	g_return_val_if_fail(crt->scheme, NULL);
+	g_return_val_if_fail(crt->scheme->get_issuer_unique_id, NULL);
+
+	return (crt->scheme->get_issuer_unique_id)(crt);
+}
+
+gchar *
 purple_certificate_get_subject_name(PurpleCertificate *crt)
 {
 	PurpleCertificateScheme *scheme;
--- a/libpurple/certificate.h	Tue Aug 07 20:29:35 2007 +0000
+++ b/libpurple/certificate.h	Tue Aug 07 23:26:54 2007 +0000
@@ -469,6 +469,24 @@
 GByteArray *
 purple_certificate_get_fingerprint_sha1(PurpleCertificate *crt);
 
+/**
+ * Get a unique identifier for the certificate
+ *
+ * @param crt        Certificate instance
+ * @return String representing the certificate uniquely. Must be g_free()'ed
+ */
+gchar *
+purple_certificate_get_unique_id(PurpleCertificate *crt);
+
+/**
+ * Get a unique identifier for the certificate's issuer
+ *
+ * @param crt        Certificate instance
+ * @return String representing the certificate's issuer uniquely. Must be
+ *         g_free()'ed
+ */
+gchar *
+purple_certificate_get_issuer_unique_id(PurpleCertificate *crt);
 
 /**
  * Gets the certificate subject's name