Mercurial > pidgin
changeset 18928:299022c9b32d
- More API additions
author | William Ehlhardt <williamehlhardt@gmail.com> |
---|---|
date | Thu, 21 Jun 2007 19:14:06 +0000 |
parents | 9abc911c65aa |
children | 67cb28c0ec89 |
files | libpurple/certificate.h |
diffstat | 1 files changed, 45 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/certificate.h Thu Jun 21 19:13:28 2007 +0000 +++ b/libpurple/certificate.h Thu Jun 21 19:14:06 2007 +0000 @@ -35,8 +35,17 @@ extern "C" { #endif /* __cplusplus */ + +typedef enum +{ + PURPLE_CERTIFICATE_INVALID = 0, + PURPLE_CERTIFICATE_VALID = 1 +} PurpleCertificateVerificationStatus; + typedef struct _PurpleCertificate PurpleCertificate; typedef struct _PurpleCertificateScheme PurpleCertificateScheme; +typedef struct _PurpleCertificateVerifier PurpleCertificateVerifier; +typedef struct _PurpleCertificateVerificationRequest PurpleCertificateVerificationRequest; /** A certificate instance * @@ -70,6 +79,8 @@ /** User-friendly name for this type * ex: N_("X.509 Certificates") + * When this is displayed anywhere, it should be i18ned + * ex: _(scheme->name) */ gchar * fullname; @@ -95,6 +106,40 @@ /* TODO: Fill out this structure */ }; +/** A set of operations used to provide logic for verifying a Certificate's + * authenticity. + */ +struct _PurpleCertificateVerifier +{ + /** Scheme this Verifier operates on */ + PurpleCertificateScheme *scheme; + + /** Internal name used for lookups + * + * Case insensitive + */ + gchar * name; +}; + +/** Structure for a single certificate request + * + * Useful for keeping track of the state of a verification that involves + * several steps + */ +struct _PurpleCertificateVerificationRequest +{ + /** Reference to the verification logic used */ + PurpleCertificateVerifier *verifier; + + /** List of certificates in the chain to be verified. + * + * This is most relevant for X.509 certificates used in SSL sessions. + */ + GList *cert_chain; + + /** Internal data used by the Verifier code */ + gpointer *data; +}; /*****************************************************************************/ /** @name PurpleCertificate Subsystem API */