changeset 18934:04be1b885ef3

- Add more to the Certificate struct
author William Ehlhardt <williamehlhardt@gmail.com>
date Thu, 21 Jun 2007 23:39:26 +0000
parents 6ed0cfe57453
children cb9d2b9ad6bc
files libpurple/certificate.h libpurple/plugins/ssl/ssl-gnutls.c
diffstat 2 files changed, 44 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/certificate.h	Thu Jun 21 22:53:54 2007 +0000
+++ b/libpurple/certificate.h	Thu Jun 21 23:39:26 2007 +0000
@@ -102,6 +102,45 @@
 	 *              CertificateScheme. Can be NULL
 	 */
 	void (* destroy_certificate)(PurpleCertificate * crt);
+
+	/**
+	 * Retrieves the certificate public key fingerprint using SHA1
+	 *
+	 * @param crt   Certificate instance
+	 * @return Binary representation of SHA1 hash
+	 */
+	GByteArray * (* get_fingerprint_sha1)(PurpleCertificate *crt);
+
+	/**
+	 * Reads "who the certificate is assigned to"
+	 *
+	 * For SSL X.509 certificates, this is something like
+	 * "gmail.com" or "jabber.org"
+	 *
+	 * @param crt   Certificate instance
+	 * @return Newly allocated string specifying "whose certificate this
+	 *         is"
+	 */
+	gchar * (* get_certificate_subject)(PurpleCertificate *crt);
+
+	/**
+	 * Retrieves a unique certificate identifier
+	 *
+	 * @param crt   Certificate instance
+	 * @return Newly allocated string that can be used to uniquely
+	 *         identify the certificate.
+	 */
+	gchar * (* get_unique_id)(PurpleCertificate *crt);
+
+	/**
+	 * Retrieves a unique identifier for the certificate's issuer
+	 *
+	 * @param crt   Certificate instance
+	 * @return Newly allocated string that can be used to uniquely
+	 *         identify the issuer's certificate.
+	 */
+	gchar * (* get_issuer_unique_id)(PurpleCertificate *crt);
+
 	
 	/* TODO: Fill out this structure */
 };
--- a/libpurple/plugins/ssl/ssl-gnutls.c	Thu Jun 21 22:53:54 2007 +0000
+++ b/libpurple/plugins/ssl/ssl-gnutls.c	Thu Jun 21 23:39:26 2007 +0000
@@ -527,7 +527,11 @@
 	"x509",                          /* Scheme name */
 	N_("X.509 Certificates"),        /* User-visible scheme name */
 	x509_import_from_file,           /* Certificate import function */
-	x509_destroy_certificate         /* Destroy cert */
+	x509_destroy_certificate,        /* Destroy cert */
+	NULL,                            /* SHA1 fingerprint */
+	NULL,                            /* Subject */
+	NULL,                            /* Unique ID */
+	NULL                             /* Issuer Unique ID */
 };
 
 static PurpleSslOps ssl_ops =