annotate libpurple/certificate.h @ 18933:6ed0cfe57453

disapproval of revision 'e2dc62de3f75a0206694f16b62b58dd12e062829'
author William Ehlhardt <williamehlhardt@gmail.com>
date Thu, 21 Jun 2007 22:53:54 +0000
parents d0d88bd477c1
children 04be1b885ef3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17910
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
1 /**
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
2 * @file certificate.h Public-Key Certificate API
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
3 * @ingroup core
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
4 */
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
5
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
6 /*
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
7 *
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
8 * purple
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
9 *
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
10 * Purple is the legal property of its developers, whose names are too numerous
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
11 * to list here. Please refer to the COPYRIGHT file distributed with this
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
12 * source distribution.
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
13 *
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
14 * This program is free software; you can redistribute it and/or modify
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
15 * it under the terms of the GNU General Public License as published by
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
16 * the Free Software Foundation; either version 2 of the License, or
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
17 * (at your option) any later version.
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
18 *
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
19 * This program is distributed in the hope that it will be useful,
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
22 * GNU General Public License for more details.
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
23 *
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
24 * You should have received a copy of the GNU General Public License
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
25 * along with this program; if not, write to the Free Software
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
27 */
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
28
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
29 #ifndef _PURPLE_CERTIFICATE_H
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
30 #define _PURPLE_CERTIFICATE_H
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
31
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
32 #include <glib.h>
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
33
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
34 #ifdef __cplusplus
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
35 extern "C" {
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
36 #endif /* __cplusplus */
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
37
18928
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
38
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
39 typedef enum
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
40 {
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
41 PURPLE_CERTIFICATE_INVALID = 0,
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
42 PURPLE_CERTIFICATE_VALID = 1
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
43 } PurpleCertificateVerificationStatus;
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
44
18189
030a2209ae96 - Style issues
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18188
diff changeset
45 typedef struct _PurpleCertificate PurpleCertificate;
030a2209ae96 - Style issues
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18188
diff changeset
46 typedef struct _PurpleCertificateScheme PurpleCertificateScheme;
18928
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
47 typedef struct _PurpleCertificateVerifier PurpleCertificateVerifier;
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
48 typedef struct _PurpleCertificateVerificationRequest PurpleCertificateVerificationRequest;
17910
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
49
17913
55a0b0a42000 - Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17912
diff changeset
50 /** A certificate instance
55a0b0a42000 - Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17912
diff changeset
51 *
55a0b0a42000 - Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17912
diff changeset
52 * An opaque data structure representing a single certificate under some
55a0b0a42000 - Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17912
diff changeset
53 * CertificateScheme
55a0b0a42000 - Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17912
diff changeset
54 */
18189
030a2209ae96 - Style issues
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18188
diff changeset
55 struct _PurpleCertificate
17913
55a0b0a42000 - Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17912
diff changeset
56 {
55a0b0a42000 - Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17912
diff changeset
57 /** Scheme this certificate is under */
18189
030a2209ae96 - Style issues
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18188
diff changeset
58 PurpleCertificateScheme * scheme;
17913
55a0b0a42000 - Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17912
diff changeset
59 /** Opaque pointer to internal data */
55a0b0a42000 - Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17912
diff changeset
60 gpointer data;
55a0b0a42000 - Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17912
diff changeset
61 };
55a0b0a42000 - Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17912
diff changeset
62
17910
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
63 /** A certificate type
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
64 *
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
65 * A CertificateScheme must implement all of the fields in the structure,
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
66 * and register it using TODO:purple_register_certscheme()
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
67 *
17912
945b60f02767 - Fixed a comment
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17910
diff changeset
68 * There may be only ONE CertificateScheme provided for each certificate
945b60f02767 - Fixed a comment
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17910
diff changeset
69 * type, as specified by the "name" field.
17910
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
70 */
18189
030a2209ae96 - Style issues
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18188
diff changeset
71 struct _PurpleCertificateScheme
17910
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
72 {
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
73 /** Name of the certificate type
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
74 * ex: "x509", "pgp", etc.
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
75 * This must be globally unique - you may not register more than one
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
76 * CertificateScheme of the same name at a time.
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
77 */
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
78 gchar * name;
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
79
18188
e6271671eb24 - Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17913
diff changeset
80 /** User-friendly name for this type
e6271671eb24 - Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17913
diff changeset
81 * ex: N_("X.509 Certificates")
18928
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
82 * When this is displayed anywhere, it should be i18ned
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
83 * ex: _(scheme->name)
18188
e6271671eb24 - Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17913
diff changeset
84 */
e6271671eb24 - Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17913
diff changeset
85 gchar * fullname;
e6271671eb24 - Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17913
diff changeset
86
e6271671eb24 - Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17913
diff changeset
87 /** Imports a certificate from a file
e6271671eb24 - Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17913
diff changeset
88 *
e6271671eb24 - Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17913
diff changeset
89 * @param filename File to import the certificate from
e6271671eb24 - Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17913
diff changeset
90 * @return Pointer to the newly allocated Certificate struct
e6271671eb24 - Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17913
diff changeset
91 * or NULL on failure.
e6271671eb24 - Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17913
diff changeset
92 */
18190
b2d110e9857f - Eliminate compiler warning
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18189
diff changeset
93 PurpleCertificate * (* import_certificate)(const gchar * filename);
18188
e6271671eb24 - Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17913
diff changeset
94
e6271671eb24 - Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17913
diff changeset
95 /** Destroys and frees a Certificate structure
e6271671eb24 - Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17913
diff changeset
96 *
e6271671eb24 - Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17913
diff changeset
97 * Destroys a Certificate's internal data structures and calls
e6271671eb24 - Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17913
diff changeset
98 * free(crt)
e6271671eb24 - Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17913
diff changeset
99 *
e6271671eb24 - Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17913
diff changeset
100 * @param crt Certificate instance to be destroyed. It WILL NOT be
e6271671eb24 - Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17913
diff changeset
101 * destroyed if it is not of the correct
e6271671eb24 - Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17913
diff changeset
102 * CertificateScheme. Can be NULL
e6271671eb24 - Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17913
diff changeset
103 */
18189
030a2209ae96 - Style issues
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18188
diff changeset
104 void (* destroy_certificate)(PurpleCertificate * crt);
18188
e6271671eb24 - Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents: 17913
diff changeset
105
17910
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
106 /* TODO: Fill out this structure */
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
107 };
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
108
18928
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
109 /** A set of operations used to provide logic for verifying a Certificate's
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
110 * authenticity.
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
111 */
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
112 struct _PurpleCertificateVerifier
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
113 {
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
114 /** Scheme this Verifier operates on */
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
115 PurpleCertificateScheme *scheme;
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
116
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
117 /** Internal name used for lookups
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
118 *
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
119 * Case insensitive
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
120 */
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
121 gchar * name;
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
122 };
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
123
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
124 /** Structure for a single certificate request
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
125 *
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
126 * Useful for keeping track of the state of a verification that involves
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
127 * several steps
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
128 */
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
129 struct _PurpleCertificateVerificationRequest
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
130 {
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
131 /** Reference to the verification logic used */
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
132 PurpleCertificateVerifier *verifier;
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
133
18931
e634122cec47 - purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18928
diff changeset
134 /** Certificate subject's name.
e634122cec47 - purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18928
diff changeset
135 *
e634122cec47 - purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18928
diff changeset
136 * For X.509 certificates, this is the Common Name
e634122cec47 - purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18928
diff changeset
137 */
e634122cec47 - purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18928
diff changeset
138 gchar *subject_name;
e634122cec47 - purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18928
diff changeset
139
e634122cec47 - purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18928
diff changeset
140 /** List of certificates in the chain to be verified (such as that returned by purple_ssl_get_peer_certificates )
18928
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
141 *
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
142 * This is most relevant for X.509 certificates used in SSL sessions.
18931
e634122cec47 - purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18928
diff changeset
143 * The list order should be: certificate, issuer, issuer's issuer, etc.
18928
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
144 */
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
145 GList *cert_chain;
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
146
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
147 /** Internal data used by the Verifier code */
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
148 gpointer *data;
299022c9b32d - More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18926
diff changeset
149 };
17910
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
150
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
151 /*****************************************************************************/
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
152 /** @name PurpleCertificate Subsystem API */
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
153 /*****************************************************************************/
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
154 /*@{*/
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
155
18192
dc7e7b8bdc8c - Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18190
diff changeset
156 /** Look up a registered CertificateScheme by name
dc7e7b8bdc8c - Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18190
diff changeset
157 * @param name The scheme name. Case insensitive.
dc7e7b8bdc8c - Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18190
diff changeset
158 * @return Pointer to the located Scheme, or NULL if it isn't found.
dc7e7b8bdc8c - Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18190
diff changeset
159 */
dc7e7b8bdc8c - Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18190
diff changeset
160 PurpleCertificateScheme *
dc7e7b8bdc8c - Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18190
diff changeset
161 purple_certificate_find_scheme(const gchar *name);
dc7e7b8bdc8c - Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18190
diff changeset
162
dc7e7b8bdc8c - Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18190
diff changeset
163 /** Register a CertificateScheme with libpurple
dc7e7b8bdc8c - Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18190
diff changeset
164 *
dc7e7b8bdc8c - Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18190
diff changeset
165 * No two schemes can be registered with the same name; this function enforces
dc7e7b8bdc8c - Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18190
diff changeset
166 * that.
dc7e7b8bdc8c - Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18190
diff changeset
167 *
dc7e7b8bdc8c - Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18190
diff changeset
168 * @param scheme Pointer to the scheme to register.
dc7e7b8bdc8c - Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18190
diff changeset
169 * @return TRUE if the scheme was successfully added, otherwise FALSE
dc7e7b8bdc8c - Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18190
diff changeset
170 */
dc7e7b8bdc8c - Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18190
diff changeset
171 gboolean
dc7e7b8bdc8c - Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18190
diff changeset
172 purple_certificate_register_scheme(PurpleCertificateScheme *scheme);
dc7e7b8bdc8c - Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18190
diff changeset
173
18926
8c4d52bc0319 - Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18192
diff changeset
174 /** Unregister a CertificateScheme from libpurple
8c4d52bc0319 - Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18192
diff changeset
175 *
8c4d52bc0319 - Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18192
diff changeset
176 * @param scheme Scheme to unregister.
8c4d52bc0319 - Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18192
diff changeset
177 * If the scheme is not registered, this is a no-op.
8c4d52bc0319 - Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18192
diff changeset
178 *
8c4d52bc0319 - Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18192
diff changeset
179 * @return TRUE if the unregister completed successfully
8c4d52bc0319 - Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18192
diff changeset
180 */
8c4d52bc0319 - Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18192
diff changeset
181 gboolean
8c4d52bc0319 - Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18192
diff changeset
182 purple_certificate_unregister_scheme(PurpleCertificateScheme *scheme);
8c4d52bc0319 - Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18192
diff changeset
183
17910
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
184 /* TODO: ADD STUFF HERE */
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
185
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
186 /*@}*/
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
187
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
188
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
189 #ifdef __cplusplus
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
190 }
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
191 #endif /* __cplusplus */
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
192
668a294f9a72 - Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff changeset
193 #endif /* _PURPLE_CERTIFICATE_H */