# HG changeset patch # User William Ehlhardt # Date 1182453246 0 # Node ID 299022c9b32d462e0ed9992c2df0e69c55af3236 # Parent 9abc911c65aad38dadc97bd8eb5168b5df981a86 - More API additions diff -r 9abc911c65aa -r 299022c9b32d libpurple/certificate.h --- 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 */