Mercurial > pidgin.yaz
annotate libpurple/certificate.h @ 18969:17a6a99e7230
- Replace switch statements in irc and jabber prpls with purple_ssl_strerror calls
author | William Ehlhardt <williamehlhardt@gmail.com> |
---|---|
date | Wed, 27 Jun 2007 05:03:25 +0000 |
parents | fcd05c39803e |
children | 3d63bd78675d |
rev | line source |
---|---|
17638
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; |
17638
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
49 |
18940
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
50 /** |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
51 * Callback function for the results of a verification check |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
52 * @param st Status code |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
53 * @param userdata User-defined data |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
54 */ |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
55 typedef void (*PurpleCertificateVerifiedCallback) |
18953
89b32569890c
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18952
diff
changeset
|
56 (PurpleCertificateVerificationStatus st, |
18940
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
57 gpointer userdata); |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
58 |
17641
55a0b0a42000
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17640
diff
changeset
|
59 /** A certificate instance |
55a0b0a42000
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17640
diff
changeset
|
60 * |
55a0b0a42000
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17640
diff
changeset
|
61 * 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:
17640
diff
changeset
|
62 * CertificateScheme |
55a0b0a42000
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17640
diff
changeset
|
63 */ |
18189
030a2209ae96
- Style issues
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18188
diff
changeset
|
64 struct _PurpleCertificate |
17641
55a0b0a42000
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17640
diff
changeset
|
65 { |
55a0b0a42000
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17640
diff
changeset
|
66 /** Scheme this certificate is under */ |
18189
030a2209ae96
- Style issues
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18188
diff
changeset
|
67 PurpleCertificateScheme * scheme; |
17641
55a0b0a42000
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17640
diff
changeset
|
68 /** Opaque pointer to internal data */ |
55a0b0a42000
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17640
diff
changeset
|
69 gpointer data; |
55a0b0a42000
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17640
diff
changeset
|
70 }; |
55a0b0a42000
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17640
diff
changeset
|
71 |
17638
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
72 /** A certificate type |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
73 * |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
74 * A CertificateScheme must implement all of the fields in the structure, |
18936
895831f93380
- Documentation correction
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18934
diff
changeset
|
75 * and register it using purple_certificate_register_scheme() |
17638
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
76 * |
17640
945b60f02767
- Fixed a comment
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17638
diff
changeset
|
77 * There may be only ONE CertificateScheme provided for each certificate |
945b60f02767
- Fixed a comment
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17638
diff
changeset
|
78 * type, as specified by the "name" field. |
17638
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
79 */ |
18189
030a2209ae96
- Style issues
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18188
diff
changeset
|
80 struct _PurpleCertificateScheme |
17638
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
81 { |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
82 /** Name of the certificate type |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
83 * ex: "x509", "pgp", etc. |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
84 * 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
|
85 * 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
|
86 */ |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
87 gchar * name; |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
88 |
18188
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17641
diff
changeset
|
89 /** User-friendly name for this type |
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17641
diff
changeset
|
90 * ex: N_("X.509 Certificates") |
18928
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
91 * When this is displayed anywhere, it should be i18ned |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
92 * ex: _(scheme->name) |
18188
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17641
diff
changeset
|
93 */ |
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17641
diff
changeset
|
94 gchar * fullname; |
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17641
diff
changeset
|
95 |
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17641
diff
changeset
|
96 /** Imports a certificate from a file |
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17641
diff
changeset
|
97 * |
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17641
diff
changeset
|
98 * @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:
17641
diff
changeset
|
99 * @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:
17641
diff
changeset
|
100 * or NULL on failure. |
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17641
diff
changeset
|
101 */ |
18190
b2d110e9857f
- Eliminate compiler warning
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18189
diff
changeset
|
102 PurpleCertificate * (* import_certificate)(const gchar * filename); |
18188
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17641
diff
changeset
|
103 |
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17641
diff
changeset
|
104 /** Destroys and frees a Certificate structure |
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17641
diff
changeset
|
105 * |
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17641
diff
changeset
|
106 * 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:
17641
diff
changeset
|
107 * free(crt) |
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17641
diff
changeset
|
108 * |
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17641
diff
changeset
|
109 * @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:
17641
diff
changeset
|
110 * 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:
17641
diff
changeset
|
111 * CertificateScheme. Can be NULL |
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17641
diff
changeset
|
112 */ |
18189
030a2209ae96
- Style issues
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18188
diff
changeset
|
113 void (* destroy_certificate)(PurpleCertificate * crt); |
18934
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
114 |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
115 /** |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
116 * Retrieves the certificate public key fingerprint using SHA1 |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
117 * |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
118 * @param crt Certificate instance |
18937
eac58c6caae7
- More documentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18936
diff
changeset
|
119 * @return Binary representation of SHA1 hash - must be freed using |
eac58c6caae7
- More documentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18936
diff
changeset
|
120 * g_byte_array_free() |
18934
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
121 */ |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
122 GByteArray * (* get_fingerprint_sha1)(PurpleCertificate *crt); |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
123 |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
124 /** |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
125 * Reads "who the certificate is assigned to" |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
126 * |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
127 * For SSL X.509 certificates, this is something like |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
128 * "gmail.com" or "jabber.org" |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
129 * |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
130 * @param crt Certificate instance |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
131 * @return Newly allocated string specifying "whose certificate this |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
132 * is" |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
133 */ |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
134 gchar * (* get_certificate_subject)(PurpleCertificate *crt); |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
135 |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
136 /** |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
137 * Retrieves a unique certificate identifier |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
138 * |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
139 * @param crt Certificate instance |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
140 * @return Newly allocated string that can be used to uniquely |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
141 * identify the certificate. |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
142 */ |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
143 gchar * (* get_unique_id)(PurpleCertificate *crt); |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
144 |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
145 /** |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
146 * Retrieves a unique identifier for the certificate's issuer |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
147 * |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
148 * @param crt Certificate instance |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
149 * @return Newly allocated string that can be used to uniquely |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
150 * identify the issuer's certificate. |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
151 */ |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
152 gchar * (* get_issuer_unique_id)(PurpleCertificate *crt); |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
153 |
18962
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
154 /** |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
155 * Gets the certificate subject's name |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
156 * |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
157 * For X.509, this is the "Common Name" field, as we're only using it |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
158 * for hostname verification at the moment |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
159 * |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
160 * @see purple_certificate_get_subject_name() |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
161 * |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
162 * @param crt Certificate instance |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
163 * @return Newly allocated string with the certificate subject. |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
164 */ |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
165 gchar * (* get_subject_name)(PurpleCertificate *crt); |
17638
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
166 /* TODO: Fill out this structure */ |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
167 }; |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
168 |
18928
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
169 /** 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
|
170 * authenticity. |
18941
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
171 * |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
172 * A Verifier provider must fill out these fields, then register it using |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
173 * purple_certificate_register_verifier() |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
174 * |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
175 * The (scheme_name, name) value must be unique for each Verifier - you may not |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
176 * register more than one Verifier of the same name for each Scheme |
18928
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
177 */ |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
178 struct _PurpleCertificateVerifier |
18940
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
179 { |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
180 /** Name of the scheme this Verifier operates on |
18928
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
181 * |
18940
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
182 * The scheme will be looked up by name when a Request is generated |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
183 * using this Verifier |
18928
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
184 */ |
18940
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
185 gchar *scheme_name; |
18941
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
186 |
18951
11e88e451bfb
- Reorder struct for clarity
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18950
diff
changeset
|
187 /** Name of the Verifier - case insensitive */ |
11e88e451bfb
- Reorder struct for clarity
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18950
diff
changeset
|
188 gchar *name; |
11e88e451bfb
- Reorder struct for clarity
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18950
diff
changeset
|
189 |
18941
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
190 /** |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
191 * Start the verification process |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
192 * |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
193 * To be called from purple_certificate_verify once it has |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
194 * constructed the request. This will use the information in the |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
195 * given VerificationRequest to check the certificate and callback |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
196 * the requester with the verification results. |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
197 * |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
198 * @param vrq Request to process |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
199 */ |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
200 void (* start_verification)(PurpleCertificateVerificationRequest *vrq); |
18947
3c6bf77bf7c4
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18946
diff
changeset
|
201 |
3c6bf77bf7c4
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18946
diff
changeset
|
202 /** |
3c6bf77bf7c4
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18946
diff
changeset
|
203 * Destroy a completed Request under this Verifier |
18952
974d110cf7b1
- libpurple is now responsible for some cleanup and final deletion of a
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18951
diff
changeset
|
204 * The function pointed to here is only responsible for cleaning up |
974d110cf7b1
- libpurple is now responsible for some cleanup and final deletion of a
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18951
diff
changeset
|
205 * whatever PurpleCertificateVerificationRequest::data points to. |
974d110cf7b1
- libpurple is now responsible for some cleanup and final deletion of a
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18951
diff
changeset
|
206 * It should not call free(vrq) |
18947
3c6bf77bf7c4
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18946
diff
changeset
|
207 * |
3c6bf77bf7c4
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18946
diff
changeset
|
208 * @param vrq Request to destroy |
3c6bf77bf7c4
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18946
diff
changeset
|
209 */ |
3c6bf77bf7c4
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18946
diff
changeset
|
210 void (* destroy_request)(PurpleCertificateVerificationRequest *vrq); |
18928
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
211 }; |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
212 |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
213 /** Structure for a single certificate request |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
214 * |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
215 * 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
|
216 * several steps |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
217 */ |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
218 struct _PurpleCertificateVerificationRequest |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
219 { |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
220 /** Reference to the verification logic used */ |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
221 PurpleCertificateVerifier *verifier; |
18941
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
222 /** Reference to the scheme used. |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
223 * |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
224 * This is looked up from the Verifier when the Request is generated |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
225 */ |
18942
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
226 PurpleCertificateScheme *scheme; |
18928
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
227 |
18940
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
228 /** |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
229 * Name to check that the certificate is issued to |
18931
e634122cec47
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18928
diff
changeset
|
230 * |
e634122cec47
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18928
diff
changeset
|
231 * For X.509 certificates, this is the Common Name |
e634122cec47
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18928
diff
changeset
|
232 */ |
e634122cec47
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18928
diff
changeset
|
233 gchar *subject_name; |
e634122cec47
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18928
diff
changeset
|
234 |
e634122cec47
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18928
diff
changeset
|
235 /** 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
|
236 * |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
237 * 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
|
238 * 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
|
239 */ |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
240 GList *cert_chain; |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
241 |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
242 /** Internal data used by the Verifier code */ |
18940
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
243 gpointer data; |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
244 |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
245 /** Function to call with the verification result */ |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
246 PurpleCertificateVerifiedCallback cb; |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
247 /** Data to pass to the post-verification callback */ |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
248 gpointer cb_data; |
18928
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
249 }; |
17638
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
250 |
18945
fa42d8fa7873
- Documentation segmentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18942
diff
changeset
|
251 /*****************************************************************************/ |
fa42d8fa7873
- Documentation segmentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18942
diff
changeset
|
252 /** @name PurpleCertificate API */ |
fa42d8fa7873
- Documentation segmentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18942
diff
changeset
|
253 /*****************************************************************************/ |
fa42d8fa7873
- Documentation segmentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18942
diff
changeset
|
254 /*@{*/ |
fa42d8fa7873
- Documentation segmentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18942
diff
changeset
|
255 |
18942
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
256 /** |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
257 * Constructs a verification request and passed control to the specified Verifier |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
258 * |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
259 * It is possible that the callback will be called immediately upon calling |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
260 * this function. Plan accordingly. |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
261 * |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
262 * @param verifier Verification logic to use. |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
263 * @see purple_certificate_find_verifier() |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
264 * |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
265 * @param subject_name Name that should match the first certificate in the |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
266 * chain for the certificate to be valid. Will be strdup'd |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
267 * into the Request struct |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
268 * |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
269 * @param cert_chain Certificate chain to check. If there is more than one |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
270 * certificate in the chain (X.509), the peer's |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
271 * certificate comes first, then the issuer/signer's |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
272 * certificate, etc. |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
273 * |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
274 * @param cb Callback function to be called with whether the |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
275 * certificate was approved or not. |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
276 * @param cb_data User-defined data for the above. |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
277 */ |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
278 void |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
279 purple_certificate_verify (PurpleCertificateVerifier *verifier, |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
280 const gchar *subject_name, GList *cert_chain, |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
281 PurpleCertificateVerifiedCallback cb, |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
282 gpointer cb_data); |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
283 |
18946
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
284 /** |
18947
3c6bf77bf7c4
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18946
diff
changeset
|
285 * Disposes of a VerificationRequest once it is complete |
3c6bf77bf7c4
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18946
diff
changeset
|
286 * |
3c6bf77bf7c4
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18946
diff
changeset
|
287 * @param vrq Request to destroy. Will be free()'d. |
3c6bf77bf7c4
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18946
diff
changeset
|
288 * The certificate chain involved will also be destroyed. |
3c6bf77bf7c4
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18946
diff
changeset
|
289 */ |
3c6bf77bf7c4
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18946
diff
changeset
|
290 void |
3c6bf77bf7c4
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18946
diff
changeset
|
291 purple_certificate_verify_destroy (PurpleCertificateVerificationRequest *vrq); |
3c6bf77bf7c4
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18946
diff
changeset
|
292 |
3c6bf77bf7c4
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18946
diff
changeset
|
293 /** |
18946
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
294 * Destroys and free()'s a Certificate |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
295 * |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
296 * @param crt Instance to destroy. May be NULL. |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
297 */ |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
298 void |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
299 purple_certificate_destroy (PurpleCertificate *crt); |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
300 |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
301 /** |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
302 * Destroy an entire list of Certificate instances and the containing list |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
303 * |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
304 * @param crt_list List of certificates to destroy. May be NULL. |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
305 */ |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
306 void |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
307 purple_certificate_destroy_list (GList * crt_list); |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
308 |
18953
89b32569890c
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18952
diff
changeset
|
309 /** |
89b32569890c
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18952
diff
changeset
|
310 * Retrieves the certificate public key fingerprint using SHA1. |
89b32569890c
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18952
diff
changeset
|
311 * |
89b32569890c
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18952
diff
changeset
|
312 * @param crt Certificate instance |
89b32569890c
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18952
diff
changeset
|
313 * @return Binary representation of the hash. You are responsible for free()ing |
89b32569890c
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18952
diff
changeset
|
314 * this. |
89b32569890c
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18952
diff
changeset
|
315 * @see purple_base16_encode_chunked() |
89b32569890c
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18952
diff
changeset
|
316 */ |
89b32569890c
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18952
diff
changeset
|
317 GByteArray * |
89b32569890c
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18952
diff
changeset
|
318 purple_certificate_get_fingerprint_sha1(PurpleCertificate *crt); |
89b32569890c
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18952
diff
changeset
|
319 |
18962
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
320 |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
321 /** |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
322 * Gets the certificate subject's name |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
323 * |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
324 * For X.509, this is the "Common Name" field, as we're only using it |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
325 * for hostname verification at the moment |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
326 * |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
327 * @param crt Certificate instance |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
328 * @return Newly allocated string with the certificate subject. |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
329 */ |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
330 gchar * |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
331 purple_certificate_get_subject_name(PurpleCertificate *crt); |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
332 |
18945
fa42d8fa7873
- Documentation segmentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18942
diff
changeset
|
333 /*@}*/ |
fa42d8fa7873
- Documentation segmentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18942
diff
changeset
|
334 |
17638
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
335 /*****************************************************************************/ |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
336 /** @name PurpleCertificate Subsystem API */ |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
337 /*****************************************************************************/ |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
338 /*@{*/ |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
339 |
18950
f78a9efa9eaf
- Add purple_certificate_register_builtins
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18947
diff
changeset
|
340 /** |
18957
9205841eed06
- Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18953
diff
changeset
|
341 * Initialize the certificate system |
18950
f78a9efa9eaf
- Add purple_certificate_register_builtins
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18947
diff
changeset
|
342 */ |
f78a9efa9eaf
- Add purple_certificate_register_builtins
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18947
diff
changeset
|
343 void |
18957
9205841eed06
- Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18953
diff
changeset
|
344 purple_certificate_init(void); |
9205841eed06
- Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18953
diff
changeset
|
345 |
9205841eed06
- Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18953
diff
changeset
|
346 /** |
9205841eed06
- Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18953
diff
changeset
|
347 * Un-initialize the certificate system |
9205841eed06
- Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18953
diff
changeset
|
348 */ |
9205841eed06
- Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18953
diff
changeset
|
349 void |
9205841eed06
- Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18953
diff
changeset
|
350 purple_certificate_uninit(void); |
18950
f78a9efa9eaf
- Add purple_certificate_register_builtins
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18947
diff
changeset
|
351 |
18192
dc7e7b8bdc8c
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18190
diff
changeset
|
352 /** 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
|
353 * @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
|
354 * @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
|
355 */ |
dc7e7b8bdc8c
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18190
diff
changeset
|
356 PurpleCertificateScheme * |
dc7e7b8bdc8c
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18190
diff
changeset
|
357 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
|
358 |
dc7e7b8bdc8c
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18190
diff
changeset
|
359 /** Register a CertificateScheme with libpurple |
dc7e7b8bdc8c
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18190
diff
changeset
|
360 * |
dc7e7b8bdc8c
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18190
diff
changeset
|
361 * 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
|
362 * that. |
dc7e7b8bdc8c
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18190
diff
changeset
|
363 * |
dc7e7b8bdc8c
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18190
diff
changeset
|
364 * @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
|
365 * @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
|
366 */ |
dc7e7b8bdc8c
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18190
diff
changeset
|
367 gboolean |
dc7e7b8bdc8c
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18190
diff
changeset
|
368 purple_certificate_register_scheme(PurpleCertificateScheme *scheme); |
dc7e7b8bdc8c
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18190
diff
changeset
|
369 |
18926
8c4d52bc0319
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18192
diff
changeset
|
370 /** Unregister a CertificateScheme from libpurple |
8c4d52bc0319
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18192
diff
changeset
|
371 * |
8c4d52bc0319
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18192
diff
changeset
|
372 * @param scheme Scheme to unregister. |
8c4d52bc0319
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18192
diff
changeset
|
373 * If the scheme is not registered, this is a no-op. |
8c4d52bc0319
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18192
diff
changeset
|
374 * |
8c4d52bc0319
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18192
diff
changeset
|
375 * @return TRUE if the unregister completed successfully |
8c4d52bc0319
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18192
diff
changeset
|
376 */ |
8c4d52bc0319
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18192
diff
changeset
|
377 gboolean |
8c4d52bc0319
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18192
diff
changeset
|
378 purple_certificate_unregister_scheme(PurpleCertificateScheme *scheme); |
8c4d52bc0319
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18192
diff
changeset
|
379 |
18941
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
380 /** Look up a registered PurpleCertificateVerifier by scheme and name |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
381 * @param scheme_name Scheme name. Case insensitive. |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
382 * @param ver_name The verifier name. Case insensitive. |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
383 * @return Pointer to the located Verifier, or NULL if it isn't found. |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
384 */ |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
385 PurpleCertificateVerifier * |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
386 purple_certificate_find_verifier(const gchar *scheme_name, const gchar *ver_name); |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
387 |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
388 |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
389 /** |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
390 * Register a CertificateVerifier with libpurple |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
391 * |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
392 * @param vr Verifier to register. |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
393 * @return TRUE if register succeeded, otherwise FALSE |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
394 */ |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
395 gboolean |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
396 purple_certificate_register_verifier(PurpleCertificateVerifier *vr); |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
397 |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
398 /** |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
399 * Unregister a CertificateVerifier with libpurple |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
400 * |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
401 * @param vr Verifier to unregister. |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
402 * @return TRUE if register succeeded, otherwise FALSE |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
403 */ |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
404 gboolean |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
405 purple_certificate_unregister_verifier(PurpleCertificateVerifier *vr); |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
406 |
17638
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
407 /* TODO: ADD STUFF HERE */ |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
408 |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
409 /*@}*/ |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
410 |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
411 |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
412 #ifdef __cplusplus |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
413 } |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
414 #endif /* __cplusplus */ |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
415 |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
416 #endif /* _PURPLE_CERTIFICATE_H */ |