# HG changeset patch # User William Ehlhardt # Date 1182469166 0 # Node ID 04be1b885ef30f499ed7ea4120edc78c0a61d86a # Parent 6ed0cfe574539e7e21550a697e298892336f76a8 - Add more to the Certificate struct diff -r 6ed0cfe57453 -r 04be1b885ef3 libpurple/certificate.h --- 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 */ }; diff -r 6ed0cfe57453 -r 04be1b885ef3 libpurple/plugins/ssl/ssl-gnutls.c --- 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 =