diff libpurple/certificate.h @ 32552:298080cecdc5

Add a function for converting a PurpleCertificate to a string suitable for display to the user. This is basically just a copy of purple_certificate_display_x509 right now, but it will eventually lead somewhere...
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sun, 26 Feb 2012 03:01:41 +0000
parents 98520ee78f12
children 32642aa8dbe5
line wrap: on
line diff
--- a/libpurple/certificate.h	Sun Feb 26 02:59:09 2012 +0000
+++ b/libpurple/certificate.h	Sun Feb 26 03:01:41 2012 +0000
@@ -261,8 +261,16 @@
 	 */
 	GByteArray * (* get_der_data)(PurpleCertificate *crt);
 
+	/**
+	 * Retrieves a string representation of the certificate suitable for display
+	 *
+	 * @param crt   Certificate instance
+	 * @return User-displayable string representation of certificate - must be
+	 *         freed using g_free().
+	 */
+	gchar * (* get_display_string)(PurpleCertificate *crt);
+
 	void (*_purple_reserved1)(void);
-	void (*_purple_reserved2)(void);
 };
 
 /** A set of operations used to provide logic for verifying a Certificate's
@@ -577,6 +585,17 @@
 GByteArray *
 purple_certificate_get_der_data(PurpleCertificate *crt);
 
+/**
+ * Retrieves a string suitable for displaying a certificate to the user.
+ *
+ * @param crt Certificate instance
+ *
+ * @return String representing the certificate that may be displayed to the user
+ *         - must be freed using g_free().
+ */
+char *
+purple_certificate_get_display_string(PurpleCertificate *crt);
+
 /*@}*/
 
 /*****************************************************************************/