changeset 18188:e6271671eb24

- Expose some more functions in the x509 CertificateScheme. Doesn't compile :(
author William Ehlhardt <williamehlhardt@gmail.com>
date Tue, 19 Jun 2007 17:20:16 +0000
parents 33690062e8b3
children 030a2209ae96
files libpurple/certificate.h libpurple/plugins/ssl/ssl-gnutls.c
diffstat 2 files changed, 28 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/certificate.h	Tue Jun 19 16:07:33 2007 +0000
+++ b/libpurple/certificate.h	Tue Jun 19 17:20:16 2007 +0000
@@ -68,6 +68,30 @@
 	 */
 	gchar * name;
 
+	/** User-friendly name for this type
+	 *  ex: N_("X.509 Certificates")
+	 */
+	gchar * fullname;
+
+	/** Imports a certificate from a file
+	 *
+	 *  @param filename   File to import the certificate from
+	 *  @return           Pointer to the newly allocated Certificate struct
+	 *                    or NULL on failure.
+	 */
+	Certificate * (* import_certificate)(gchar * filename);
+
+	/** Destroys and frees a Certificate structure
+	 *
+	 *  Destroys a Certificate's internal data structures and calls
+	 *  free(crt)
+	 *
+	 *  @param crt  Certificate instance to be destroyed. It WILL NOT be
+	 *              destroyed if it is not of the correct
+	 *              CertificateScheme. Can be NULL
+	 */
+	void (* destroy_certificate)(Certificate * crt);
+	
 	/* TODO: Fill out this structure */
 };
 
--- a/libpurple/plugins/ssl/ssl-gnutls.c	Tue Jun 19 16:07:33 2007 +0000
+++ b/libpurple/plugins/ssl/ssl-gnutls.c	Tue Jun 19 17:20:16 2007 +0000
@@ -344,7 +344,10 @@
 /* X.509 certificate operations provided by this plugin */
 /* TODO: Flesh this out! */
 static CertificateScheme x509_gnutls = {
-	"x509"   /* Scheme name */
+	"x509",                          /* Scheme name */
+	N_("X.509 Certificates"),        /* User-visible scheme name */
+	x509_import_from_file,           /* Certificate import function */
+	x509_destroy_certificate         /* Destroy cert */
 };
 
 /** Transforms a gnutls_datum_t containing an X.509 certificate into a Certificate instance under the x509_gnutls scheme