Mercurial > pidgin
annotate libpurple/certificate.h @ 32709:e7441440bed5
Looks like I missed a number.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Thu, 29 Dec 2011 05:42:01 +0000 |
parents | 7ceb5ca4b323 |
children | 98520ee78f12 |
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 |
20800
0077d3b6ecd2
Patch from nix_nix to add some links to signal documentation.
Will Thompson <will.thompson@collabora.co.uk>
parents:
19681
diff
changeset
|
4 * @see @ref certificate-signals |
17910
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 * |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
9 * purple |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
10 * |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
11 * 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
|
12 * 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
|
13 * source distribution. |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
14 * |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
15 * 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
|
16 * 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
|
17 * 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
|
18 * (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
|
19 * |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
20 * 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
|
21 * 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
|
22 * 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
|
23 * 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
|
24 * |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
25 * 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
|
26 * along with this program; if not, write to the Free Software |
19681
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19662
diff
changeset
|
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
17910
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 |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
30 #ifndef _PURPLE_CERTIFICATE_H |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
31 #define _PURPLE_CERTIFICATE_H |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
32 |
22267
7f7c89ff5cc7
felipec noticed that this include was missing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21647
diff
changeset
|
33 #include <time.h> |
7f7c89ff5cc7
felipec noticed that this include was missing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21647
diff
changeset
|
34 |
17910
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
35 #include <glib.h> |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
36 |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
37 #ifdef __cplusplus |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
38 extern "C" { |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
39 #endif /* __cplusplus */ |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
40 |
18928
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
41 |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
42 typedef enum |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
43 { |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
44 PURPLE_CERTIFICATE_INVALID = 0, |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
45 PURPLE_CERTIFICATE_VALID = 1 |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
46 } PurpleCertificateVerificationStatus; |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
47 |
18189
030a2209ae96
- Style issues
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18188
diff
changeset
|
48 typedef struct _PurpleCertificate PurpleCertificate; |
18970
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
49 typedef struct _PurpleCertificatePool PurpleCertificatePool; |
18189
030a2209ae96
- Style issues
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18188
diff
changeset
|
50 typedef struct _PurpleCertificateScheme PurpleCertificateScheme; |
18928
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
51 typedef struct _PurpleCertificateVerifier PurpleCertificateVerifier; |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
52 typedef struct _PurpleCertificateVerificationRequest PurpleCertificateVerificationRequest; |
17910
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
53 |
18940
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 * Callback function for the results of a verification check |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
56 * @param st Status code |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
57 * @param userdata User-defined data |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
58 */ |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
59 typedef void (*PurpleCertificateVerifiedCallback) |
18953
89b32569890c
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18952
diff
changeset
|
60 (PurpleCertificateVerificationStatus st, |
18940
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
61 gpointer userdata); |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22267
diff
changeset
|
62 |
17913
55a0b0a42000
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17912
diff
changeset
|
63 /** A certificate instance |
55a0b0a42000
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17912
diff
changeset
|
64 * |
55a0b0a42000
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17912
diff
changeset
|
65 * 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
|
66 * CertificateScheme |
55a0b0a42000
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17912
diff
changeset
|
67 */ |
18189
030a2209ae96
- Style issues
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18188
diff
changeset
|
68 struct _PurpleCertificate |
17913
55a0b0a42000
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17912
diff
changeset
|
69 { |
55a0b0a42000
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17912
diff
changeset
|
70 /** Scheme this certificate is under */ |
18189
030a2209ae96
- Style issues
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18188
diff
changeset
|
71 PurpleCertificateScheme * scheme; |
17913
55a0b0a42000
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17912
diff
changeset
|
72 /** Opaque pointer to internal data */ |
55a0b0a42000
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17912
diff
changeset
|
73 gpointer data; |
55a0b0a42000
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17912
diff
changeset
|
74 }; |
55a0b0a42000
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17912
diff
changeset
|
75 |
18970
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
76 /** |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
77 * Database for retrieval or storage of Certificates |
18983
bb4acabd8fac
Documentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18982
diff
changeset
|
78 * |
18995
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
79 * More or less a hash table; all lookups and writes are controlled by a string |
18983
bb4acabd8fac
Documentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18982
diff
changeset
|
80 * key. |
18970
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
81 */ |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
82 struct _PurpleCertificatePool |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
83 { |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
84 /** Scheme this Pool operates for */ |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
85 gchar *scheme_name; |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
86 /** Internal name to refer to the pool by */ |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
87 gchar *name; |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
88 |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
89 /** User-friendly name for this type |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
90 * ex: N_("SSL Servers") |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
91 * When this is displayed anywhere, it should be i18ned |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
92 * ex: _(pool->fullname) |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
93 */ |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
94 gchar *fullname; |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
95 |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
96 /** Internal pool data */ |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
97 gpointer data; |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22267
diff
changeset
|
98 |
18970
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
99 /** |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
100 * Set up the Pool's internal state |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
101 * |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
102 * Upon calling purple_certificate_register_pool() , this function will |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
103 * be called. May be NULL. |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
104 * @return TRUE if the initialization succeeded, otherwise FALSE |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
105 */ |
18975
172b8d1dc2be
- CertificatePool member functions no longer accept a Pool instance, as Pools are expected to be singletons
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18974
diff
changeset
|
106 gboolean (* init)(void); |
18970
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
107 |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
108 /** |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
109 * Uninit the Pool's internal state |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
110 * |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
111 * Will be called by purple_certificate_unregister_pool() . May be NULL |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
112 */ |
18975
172b8d1dc2be
- CertificatePool member functions no longer accept a Pool instance, as Pools are expected to be singletons
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18974
diff
changeset
|
113 void (* uninit)(void); |
18970
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
114 |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
115 /** Check for presence of a certificate in the pool using unique ID */ |
18974
6b7c234b4984
- cert_in_pool_by_id is now just cert_in_pool; finding the uniqueID of the Certificate wanted is entirely the caller's problem
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18971
diff
changeset
|
116 gboolean (* cert_in_pool)(const gchar *id); |
18970
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
117 /** Retrieve a PurpleCertificate from the pool */ |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
118 PurpleCertificate * (* get_cert)(const gchar *id); |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
119 /** Add a certificate to the pool. Must overwrite any other |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
120 * certificates sharing the same ID in the pool. |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
121 * @return TRUE if the operation succeeded, otherwise FALSE |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
122 */ |
18982
8948cd6bb8bc
- CertificatePool put_cert now accepts an id argument
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18977
diff
changeset
|
123 gboolean (* put_cert)(const gchar *id, PurpleCertificate *crt); |
19049
8cbc110456ac
- Add purple_certificate_pool_delete
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19034
diff
changeset
|
124 /** Delete a certificate from the pool */ |
8cbc110456ac
- Add purple_certificate_pool_delete
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19034
diff
changeset
|
125 gboolean (* delete_cert)(const gchar *id); |
19026
b3acaf46d9ad
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19023
diff
changeset
|
126 |
b3acaf46d9ad
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19023
diff
changeset
|
127 /** Returns a list of IDs stored in the pool */ |
b3acaf46d9ad
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19023
diff
changeset
|
128 GList * (* get_idlist)(void); |
19649
450f4a3c4c0f
- Add purple_reserved fields to various structures.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19329
diff
changeset
|
129 |
450f4a3c4c0f
- Add purple_reserved fields to various structures.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19329
diff
changeset
|
130 void (*_purple_reserved1)(void); |
450f4a3c4c0f
- Add purple_reserved fields to various structures.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19329
diff
changeset
|
131 void (*_purple_reserved2)(void); |
450f4a3c4c0f
- Add purple_reserved fields to various structures.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19329
diff
changeset
|
132 void (*_purple_reserved3)(void); |
450f4a3c4c0f
- Add purple_reserved fields to various structures.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19329
diff
changeset
|
133 void (*_purple_reserved4)(void); |
18970
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
134 }; |
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
135 |
17910
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
136 /** A certificate type |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
137 * |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
138 * A CertificateScheme must implement all of the fields in the structure, |
18936
895831f93380
- Documentation correction
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18934
diff
changeset
|
139 * and register it using purple_certificate_register_scheme() |
17910
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
140 * |
17912
945b60f02767
- Fixed a comment
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17910
diff
changeset
|
141 * There may be only ONE CertificateScheme provided for each certificate |
945b60f02767
- Fixed a comment
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17910
diff
changeset
|
142 * 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
|
143 */ |
18189
030a2209ae96
- Style issues
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18188
diff
changeset
|
144 struct _PurpleCertificateScheme |
17910
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
145 { |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
146 /** Name of the certificate type |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
147 * ex: "x509", "pgp", etc. |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
148 * 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
|
149 * 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
|
150 */ |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
151 gchar * name; |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
152 |
18188
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17913
diff
changeset
|
153 /** 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
|
154 * ex: N_("X.509 Certificates") |
18928
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
155 * When this is displayed anywhere, it should be i18ned |
18970
3d63bd78675d
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18962
diff
changeset
|
156 * ex: _(scheme->fullname) |
18188
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17913
diff
changeset
|
157 */ |
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17913
diff
changeset
|
158 gchar * fullname; |
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17913
diff
changeset
|
159 |
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17913
diff
changeset
|
160 /** 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
|
161 * |
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17913
diff
changeset
|
162 * @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
|
163 * @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
|
164 * or NULL on failure. |
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17913
diff
changeset
|
165 */ |
18190
b2d110e9857f
- Eliminate compiler warning
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18189
diff
changeset
|
166 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
|
167 |
18977
31bdbb82de7e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18975
diff
changeset
|
168 /** |
31bdbb82de7e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18975
diff
changeset
|
169 * Exports a certificate to a file |
31bdbb82de7e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18975
diff
changeset
|
170 * |
31bdbb82de7e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18975
diff
changeset
|
171 * @param filename File to export the certificate to |
31bdbb82de7e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18975
diff
changeset
|
172 * @param crt Certificate to export |
31bdbb82de7e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18975
diff
changeset
|
173 * @return TRUE if the export succeeded, otherwise FALSE |
31bdbb82de7e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18975
diff
changeset
|
174 * @see purple_certificate_export() |
31bdbb82de7e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18975
diff
changeset
|
175 */ |
31bdbb82de7e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18975
diff
changeset
|
176 gboolean (* export_certificate)(const gchar *filename, PurpleCertificate *crt); |
31bdbb82de7e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18975
diff
changeset
|
177 |
19018
d6f902265076
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19012
diff
changeset
|
178 /** |
d6f902265076
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19012
diff
changeset
|
179 * Duplicates a certificate |
d6f902265076
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19012
diff
changeset
|
180 * |
d6f902265076
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19012
diff
changeset
|
181 * Certificates are generally assumed to be read-only, so feel free to |
d6f902265076
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19012
diff
changeset
|
182 * do any sort of reference-counting magic you want here. If this ever |
d6f902265076
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19012
diff
changeset
|
183 * changes, please remember to change the magic accordingly. |
d6f902265076
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19012
diff
changeset
|
184 * @return Reference to the new copy |
d6f902265076
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19012
diff
changeset
|
185 */ |
d6f902265076
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19012
diff
changeset
|
186 PurpleCertificate * (* copy_certificate)(PurpleCertificate *crt); |
d6f902265076
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19012
diff
changeset
|
187 |
18188
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17913
diff
changeset
|
188 /** 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
|
189 * |
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17913
diff
changeset
|
190 * 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
|
191 * free(crt) |
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17913
diff
changeset
|
192 * |
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17913
diff
changeset
|
193 * @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
|
194 * 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
|
195 * CertificateScheme. Can be NULL |
e6271671eb24
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17913
diff
changeset
|
196 */ |
18189
030a2209ae96
- Style issues
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18188
diff
changeset
|
197 void (* destroy_certificate)(PurpleCertificate * crt); |
18934
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
198 |
19076
daa68185a018
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19067
diff
changeset
|
199 /** Find whether "crt" has a valid signature from issuer "issuer" |
daa68185a018
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19067
diff
changeset
|
200 * @see purple_certificate_signed_by() */ |
daa68185a018
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19067
diff
changeset
|
201 gboolean (*signed_by)(PurpleCertificate *crt, PurpleCertificate *issuer); |
18934
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
202 /** |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
203 * Retrieves the certificate public key fingerprint using SHA1 |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
204 * |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
205 * @param crt Certificate instance |
18937
eac58c6caae7
- More documentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18936
diff
changeset
|
206 * @return Binary representation of SHA1 hash - must be freed using |
eac58c6caae7
- More documentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18936
diff
changeset
|
207 * g_byte_array_free() |
18934
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
208 */ |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
209 GByteArray * (* get_fingerprint_sha1)(PurpleCertificate *crt); |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
210 |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
211 /** |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
212 * Retrieves a unique certificate identifier |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
213 * |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
214 * @param crt Certificate instance |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
215 * @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
|
216 * identify the certificate. |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
217 */ |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
218 gchar * (* get_unique_id)(PurpleCertificate *crt); |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
219 |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
220 /** |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
221 * 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
|
222 * |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
223 * @param crt Certificate instance |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
224 * @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
|
225 * identify the issuer's certificate. |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
226 */ |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
227 gchar * (* get_issuer_unique_id)(PurpleCertificate *crt); |
04be1b885ef3
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18933
diff
changeset
|
228 |
18962
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
229 /** |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
230 * 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
|
231 * |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
232 * 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
|
233 * 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
|
234 * |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
235 * @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
|
236 * |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
237 * @param crt Certificate instance |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
238 * @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
|
239 */ |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
240 gchar * (* get_subject_name)(PurpleCertificate *crt); |
19006
dc60287ce426
- Add get_activation_time and get_expiration_time to CertificateScheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18995
diff
changeset
|
241 |
19008
7fd9bd55f8d0
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
242 /** |
7fd9bd55f8d0
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
243 * Check the subject name against that on the certificate |
7fd9bd55f8d0
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
244 * @see purple_certificate_check_subject_name() |
7fd9bd55f8d0
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
245 * @return TRUE if it is a match, else FALSE |
7fd9bd55f8d0
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
246 */ |
7fd9bd55f8d0
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
247 gboolean (* check_subject_name)(PurpleCertificate *crt, const gchar *name); |
7fd9bd55f8d0
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
248 |
19067
6c0aad79c4c5
- Change the internal structure of activation/expiration times to match
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19060
diff
changeset
|
249 /** Retrieve the certificate activation/expiration times */ |
6c0aad79c4c5
- Change the internal structure of activation/expiration times to match
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19060
diff
changeset
|
250 gboolean (* get_times)(PurpleCertificate *crt, time_t *activation, time_t *expiration); |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22267
diff
changeset
|
251 |
29647
c35fd54ec64b
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <stu@nosnilmot.com>
parents:
27671
diff
changeset
|
252 /** Imports certificates from a file |
c35fd54ec64b
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <stu@nosnilmot.com>
parents:
27671
diff
changeset
|
253 * |
c35fd54ec64b
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <stu@nosnilmot.com>
parents:
27671
diff
changeset
|
254 * @param filename File to import the certificates from |
c35fd54ec64b
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <stu@nosnilmot.com>
parents:
27671
diff
changeset
|
255 * @return GSList of pointers to the newly allocated Certificate structs |
c35fd54ec64b
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <stu@nosnilmot.com>
parents:
27671
diff
changeset
|
256 * or NULL on failure. |
c35fd54ec64b
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <stu@nosnilmot.com>
parents:
27671
diff
changeset
|
257 */ |
c35fd54ec64b
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <stu@nosnilmot.com>
parents:
27671
diff
changeset
|
258 GSList * (* import_certificates)(const gchar * filename); |
c35fd54ec64b
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <stu@nosnilmot.com>
parents:
27671
diff
changeset
|
259 |
32414
7ceb5ca4b323
Add a function for retrieving the raw DER representation of a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32226
diff
changeset
|
260 /** |
7ceb5ca4b323
Add a function for retrieving the raw DER representation of a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32226
diff
changeset
|
261 * Retrieves the certificate data in DER form |
7ceb5ca4b323
Add a function for retrieving the raw DER representation of a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32226
diff
changeset
|
262 * |
7ceb5ca4b323
Add a function for retrieving the raw DER representation of a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32226
diff
changeset
|
263 * @param crt Certificate instance |
7ceb5ca4b323
Add a function for retrieving the raw DER representation of a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32226
diff
changeset
|
264 * @return Binary DER representation of certificate - must be freed using |
7ceb5ca4b323
Add a function for retrieving the raw DER representation of a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32226
diff
changeset
|
265 * g_byte_array_free() |
7ceb5ca4b323
Add a function for retrieving the raw DER representation of a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32226
diff
changeset
|
266 */ |
7ceb5ca4b323
Add a function for retrieving the raw DER representation of a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32226
diff
changeset
|
267 GByteArray * (* get_der_data)(PurpleCertificate *crt); |
7ceb5ca4b323
Add a function for retrieving the raw DER representation of a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32226
diff
changeset
|
268 |
19649
450f4a3c4c0f
- Add purple_reserved fields to various structures.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19329
diff
changeset
|
269 void (*_purple_reserved1)(void); |
450f4a3c4c0f
- Add purple_reserved fields to various structures.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19329
diff
changeset
|
270 void (*_purple_reserved2)(void); |
17910
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
271 }; |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
272 |
18928
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
273 /** 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
|
274 * authenticity. |
18941
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
275 * |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
276 * 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
|
277 * purple_certificate_register_verifier() |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
278 * |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
279 * 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
|
280 * 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
|
281 */ |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
282 struct _PurpleCertificateVerifier |
18940
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
283 { |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
284 /** Name of the scheme this Verifier operates on |
18928
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
285 * |
18940
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
286 * 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
|
287 * using this Verifier |
18928
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
288 */ |
18940
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
289 gchar *scheme_name; |
18941
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
290 |
18951
11e88e451bfb
- Reorder struct for clarity
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18950
diff
changeset
|
291 /** Name of the Verifier - case insensitive */ |
11e88e451bfb
- Reorder struct for clarity
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18950
diff
changeset
|
292 gchar *name; |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22267
diff
changeset
|
293 |
18941
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
294 /** |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
295 * Start the verification process |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
296 * |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
297 * To be called from purple_certificate_verify once it has |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
298 * constructed the request. This will use the information in the |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
299 * given VerificationRequest to check the certificate and callback |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
300 * the requester with the verification results. |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
301 * |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
302 * @param vrq Request to process |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
303 */ |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
304 void (* start_verification)(PurpleCertificateVerificationRequest *vrq); |
18947
3c6bf77bf7c4
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18946
diff
changeset
|
305 |
3c6bf77bf7c4
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18946
diff
changeset
|
306 /** |
3c6bf77bf7c4
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18946
diff
changeset
|
307 * 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
|
308 * 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
|
309 * 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
|
310 * 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
|
311 * |
3c6bf77bf7c4
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18946
diff
changeset
|
312 * @param vrq Request to destroy |
3c6bf77bf7c4
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18946
diff
changeset
|
313 */ |
3c6bf77bf7c4
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18946
diff
changeset
|
314 void (* destroy_request)(PurpleCertificateVerificationRequest *vrq); |
19649
450f4a3c4c0f
- Add purple_reserved fields to various structures.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19329
diff
changeset
|
315 |
450f4a3c4c0f
- Add purple_reserved fields to various structures.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19329
diff
changeset
|
316 void (*_purple_reserved1)(void); |
450f4a3c4c0f
- Add purple_reserved fields to various structures.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19329
diff
changeset
|
317 void (*_purple_reserved2)(void); |
450f4a3c4c0f
- Add purple_reserved fields to various structures.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19329
diff
changeset
|
318 void (*_purple_reserved3)(void); |
450f4a3c4c0f
- Add purple_reserved fields to various structures.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19329
diff
changeset
|
319 void (*_purple_reserved4)(void); |
18928
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
320 }; |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
321 |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
322 /** Structure for a single certificate request |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
323 * |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
324 * 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
|
325 * several steps |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
326 */ |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
327 struct _PurpleCertificateVerificationRequest |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
328 { |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
329 /** Reference to the verification logic used */ |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
330 PurpleCertificateVerifier *verifier; |
18941
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
331 /** Reference to the scheme used. |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
332 * |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
333 * 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
|
334 */ |
18942
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
335 PurpleCertificateScheme *scheme; |
18928
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
336 |
18940
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
337 /** |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
338 * 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
|
339 * |
e634122cec47
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18928
diff
changeset
|
340 * For X.509 certificates, this is the Common Name |
e634122cec47
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18928
diff
changeset
|
341 */ |
e634122cec47
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18928
diff
changeset
|
342 gchar *subject_name; |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22267
diff
changeset
|
343 |
18931
e634122cec47
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18928
diff
changeset
|
344 /** 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
|
345 * |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
346 * 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
|
347 * 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
|
348 */ |
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
349 GList *cert_chain; |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22267
diff
changeset
|
350 |
18928
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
351 /** Internal data used by the Verifier code */ |
18940
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
352 gpointer data; |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
353 |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
354 /** Function to call with the verification result */ |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
355 PurpleCertificateVerifiedCallback cb; |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
356 /** Data to pass to the post-verification callback */ |
5fa287322a82
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18937
diff
changeset
|
357 gpointer cb_data; |
18928
299022c9b32d
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18926
diff
changeset
|
358 }; |
17910
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
359 |
18945
fa42d8fa7873
- Documentation segmentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18942
diff
changeset
|
360 /*****************************************************************************/ |
18994
bf23d58ec9c3
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18989
diff
changeset
|
361 /** @name Certificate Verification Functions */ |
18945
fa42d8fa7873
- Documentation segmentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18942
diff
changeset
|
362 /*****************************************************************************/ |
fa42d8fa7873
- Documentation segmentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18942
diff
changeset
|
363 /*@{*/ |
fa42d8fa7873
- Documentation segmentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18942
diff
changeset
|
364 |
18942
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
365 /** |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
366 * 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
|
367 * |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
368 * 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
|
369 * this function. Plan accordingly. |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
370 * |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
371 * @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
|
372 * @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
|
373 * |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
374 * @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
|
375 * 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
|
376 * into the Request struct |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
377 * |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
378 * @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
|
379 * 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
|
380 * certificate comes first, then the issuer/signer's |
19021
fcca10d0ac7d
- purple_certificate_verify no longer takes possession of the
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19020
diff
changeset
|
381 * certificate, etc. The whole list is duplicated into the |
fcca10d0ac7d
- purple_certificate_verify no longer takes possession of the
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19020
diff
changeset
|
382 * Request struct. |
18942
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
383 * |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
384 * @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
|
385 * 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
|
386 * @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
|
387 */ |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
388 void |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
389 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
|
390 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
|
391 PurpleCertificateVerifiedCallback cb, |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
392 gpointer cb_data); |
02102eccc4be
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18941
diff
changeset
|
393 |
18946
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
394 /** |
19088
f5802217844d
- Add verify_complete, which should deprecate verify_destroy
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19082
diff
changeset
|
395 * Completes and destroys a VerificationRequest |
f5802217844d
- Add verify_complete, which should deprecate verify_destroy
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19082
diff
changeset
|
396 * |
f5802217844d
- Add verify_complete, which should deprecate verify_destroy
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19082
diff
changeset
|
397 * @param vrq Request to conclude |
f5802217844d
- Add verify_complete, which should deprecate verify_destroy
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19082
diff
changeset
|
398 * @param st Success/failure code to pass to the request's |
f5802217844d
- Add verify_complete, which should deprecate verify_destroy
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19082
diff
changeset
|
399 * completion callback. |
f5802217844d
- Add verify_complete, which should deprecate verify_destroy
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19082
diff
changeset
|
400 */ |
f5802217844d
- Add verify_complete, which should deprecate verify_destroy
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19082
diff
changeset
|
401 void |
f5802217844d
- Add verify_complete, which should deprecate verify_destroy
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19082
diff
changeset
|
402 purple_certificate_verify_complete(PurpleCertificateVerificationRequest *vrq, |
f5802217844d
- Add verify_complete, which should deprecate verify_destroy
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19082
diff
changeset
|
403 PurpleCertificateVerificationStatus st); |
f5802217844d
- Add verify_complete, which should deprecate verify_destroy
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19082
diff
changeset
|
404 |
18994
bf23d58ec9c3
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18989
diff
changeset
|
405 /*@}*/ |
bf23d58ec9c3
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18989
diff
changeset
|
406 |
bf23d58ec9c3
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18989
diff
changeset
|
407 /*****************************************************************************/ |
bf23d58ec9c3
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18989
diff
changeset
|
408 /** @name Certificate Functions */ |
bf23d58ec9c3
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18989
diff
changeset
|
409 /*****************************************************************************/ |
bf23d58ec9c3
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18989
diff
changeset
|
410 /*@{*/ |
bf23d58ec9c3
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18989
diff
changeset
|
411 |
18947
3c6bf77bf7c4
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18946
diff
changeset
|
412 /** |
19018
d6f902265076
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19012
diff
changeset
|
413 * Makes a duplicate of a certificate |
d6f902265076
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19012
diff
changeset
|
414 * |
d6f902265076
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19012
diff
changeset
|
415 * @param crt Instance to duplicate |
d6f902265076
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19012
diff
changeset
|
416 * @return Pointer to new instance |
d6f902265076
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19012
diff
changeset
|
417 */ |
d6f902265076
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19012
diff
changeset
|
418 PurpleCertificate * |
d6f902265076
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19012
diff
changeset
|
419 purple_certificate_copy(PurpleCertificate *crt); |
d6f902265076
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19012
diff
changeset
|
420 |
d6f902265076
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19012
diff
changeset
|
421 /** |
19020
d69355001a6e
- Add purple_certificate_copy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19018
diff
changeset
|
422 * Duplicates an entire list of certificates |
d69355001a6e
- Add purple_certificate_copy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19018
diff
changeset
|
423 * |
d69355001a6e
- Add purple_certificate_copy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19018
diff
changeset
|
424 * @param crt_list List to duplicate |
d69355001a6e
- Add purple_certificate_copy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19018
diff
changeset
|
425 * @return New list copy |
d69355001a6e
- Add purple_certificate_copy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19018
diff
changeset
|
426 */ |
d69355001a6e
- Add purple_certificate_copy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19018
diff
changeset
|
427 GList * |
d69355001a6e
- Add purple_certificate_copy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19018
diff
changeset
|
428 purple_certificate_copy_list(GList *crt_list); |
d69355001a6e
- Add purple_certificate_copy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19018
diff
changeset
|
429 |
d69355001a6e
- Add purple_certificate_copy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19018
diff
changeset
|
430 /** |
18946
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
431 * Destroys and free()'s a Certificate |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
432 * |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
433 * @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
|
434 */ |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
435 void |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
436 purple_certificate_destroy (PurpleCertificate *crt); |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
437 |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
438 /** |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
439 * 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
|
440 * |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
441 * @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
|
442 */ |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
443 void |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
444 purple_certificate_destroy_list (GList * crt_list); |
617447a71ab7
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18945
diff
changeset
|
445 |
18953
89b32569890c
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18952
diff
changeset
|
446 /** |
19076
daa68185a018
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19067
diff
changeset
|
447 * Check whether 'crt' has a valid signature made by 'issuer' |
daa68185a018
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19067
diff
changeset
|
448 * |
daa68185a018
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19067
diff
changeset
|
449 * @param crt Certificate instance to check signature of |
daa68185a018
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19067
diff
changeset
|
450 * @param issuer Certificate thought to have signed 'crt' |
daa68185a018
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19067
diff
changeset
|
451 * |
daa68185a018
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19067
diff
changeset
|
452 * @return TRUE if 'crt' has a valid signature made by 'issuer', |
daa68185a018
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19067
diff
changeset
|
453 * otherwise FALSE |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22267
diff
changeset
|
454 * @todo Find a way to give the reason (bad signature, not the issuer, etc.) |
19076
daa68185a018
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19067
diff
changeset
|
455 */ |
daa68185a018
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19067
diff
changeset
|
456 gboolean |
daa68185a018
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19067
diff
changeset
|
457 purple_certificate_signed_by(PurpleCertificate *crt, PurpleCertificate *issuer); |
daa68185a018
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19067
diff
changeset
|
458 |
daa68185a018
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19067
diff
changeset
|
459 /** |
27671
99baf778e0b9
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <paul@darkrain42.org>
parents:
25924
diff
changeset
|
460 * Check that a certificate chain is valid and, if not, the failing certificate. |
99baf778e0b9
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <paul@darkrain42.org>
parents:
25924
diff
changeset
|
461 * |
99baf778e0b9
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <paul@darkrain42.org>
parents:
25924
diff
changeset
|
462 * Uses purple_certificate_signed_by() to verify that each PurpleCertificate |
99baf778e0b9
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <paul@darkrain42.org>
parents:
25924
diff
changeset
|
463 * in the chain carries a valid signature from the next. A single-certificate |
99baf778e0b9
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <paul@darkrain42.org>
parents:
25924
diff
changeset
|
464 * chain is considered to be valid. |
99baf778e0b9
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <paul@darkrain42.org>
parents:
25924
diff
changeset
|
465 * |
99baf778e0b9
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <paul@darkrain42.org>
parents:
25924
diff
changeset
|
466 * @param chain List of PurpleCertificate instances comprising the chain, |
99baf778e0b9
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <paul@darkrain42.org>
parents:
25924
diff
changeset
|
467 * in the order certificate, issuer, issuer's issuer, etc. |
99baf778e0b9
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <paul@darkrain42.org>
parents:
25924
diff
changeset
|
468 * @param failing A pointer to a PurpleCertificate*. If not NULL, if the |
99baf778e0b9
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <paul@darkrain42.org>
parents:
25924
diff
changeset
|
469 * chain fails to validate, this will be set to the |
99baf778e0b9
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <paul@darkrain42.org>
parents:
25924
diff
changeset
|
470 * certificate whose signature could not be validated. |
99baf778e0b9
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <paul@darkrain42.org>
parents:
25924
diff
changeset
|
471 * @return TRUE if the chain is valid. See description. |
99baf778e0b9
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <paul@darkrain42.org>
parents:
25924
diff
changeset
|
472 */ |
99baf778e0b9
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <paul@darkrain42.org>
parents:
25924
diff
changeset
|
473 gboolean |
32212
1bcedeb32bb4
Remove the old deprecated purple_certificate_check_signature_chain.
andrew.victor@mxit.com
parents:
29647
diff
changeset
|
474 purple_certificate_check_signature_chain(GList *chain, |
27671
99baf778e0b9
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <paul@darkrain42.org>
parents:
25924
diff
changeset
|
475 PurpleCertificate **failing); |
99baf778e0b9
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <paul@darkrain42.org>
parents:
25924
diff
changeset
|
476 |
99baf778e0b9
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <paul@darkrain42.org>
parents:
25924
diff
changeset
|
477 /** |
18988
4189fc3befba
- Add purple_certificate_import
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18984
diff
changeset
|
478 * Imports a PurpleCertificate from a file |
4189fc3befba
- Add purple_certificate_import
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18984
diff
changeset
|
479 * |
4189fc3befba
- Add purple_certificate_import
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18984
diff
changeset
|
480 * @param scheme Scheme to import under |
4189fc3befba
- Add purple_certificate_import
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18984
diff
changeset
|
481 * @param filename File path to import from |
4189fc3befba
- Add purple_certificate_import
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18984
diff
changeset
|
482 * @return Pointer to a new PurpleCertificate, or NULL on failure |
4189fc3befba
- Add purple_certificate_import
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18984
diff
changeset
|
483 */ |
4189fc3befba
- Add purple_certificate_import
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18984
diff
changeset
|
484 PurpleCertificate * |
18989
43d1ee6a3ed5
- Fixed naming issues in previous revision
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18988
diff
changeset
|
485 purple_certificate_import(PurpleCertificateScheme *scheme, const gchar *filename); |
18988
4189fc3befba
- Add purple_certificate_import
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18984
diff
changeset
|
486 |
4189fc3befba
- Add purple_certificate_import
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18984
diff
changeset
|
487 /** |
29647
c35fd54ec64b
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <stu@nosnilmot.com>
parents:
27671
diff
changeset
|
488 * Imports a list of PurpleCertificates from a file |
c35fd54ec64b
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <stu@nosnilmot.com>
parents:
27671
diff
changeset
|
489 * |
c35fd54ec64b
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <stu@nosnilmot.com>
parents:
27671
diff
changeset
|
490 * @param scheme Scheme to import under |
c35fd54ec64b
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <stu@nosnilmot.com>
parents:
27671
diff
changeset
|
491 * @param filename File path to import from |
c35fd54ec64b
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <stu@nosnilmot.com>
parents:
27671
diff
changeset
|
492 * @return Pointer to a GSList of new PurpleCertificates, or NULL on failure |
c35fd54ec64b
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <stu@nosnilmot.com>
parents:
27671
diff
changeset
|
493 */ |
c35fd54ec64b
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <stu@nosnilmot.com>
parents:
27671
diff
changeset
|
494 GSList * |
c35fd54ec64b
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <stu@nosnilmot.com>
parents:
27671
diff
changeset
|
495 purple_certificates_import(PurpleCertificateScheme *scheme, const gchar *filename); |
c35fd54ec64b
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <stu@nosnilmot.com>
parents:
27671
diff
changeset
|
496 |
c35fd54ec64b
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <stu@nosnilmot.com>
parents:
27671
diff
changeset
|
497 /** |
18977
31bdbb82de7e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18975
diff
changeset
|
498 * Exports a PurpleCertificate to a file |
31bdbb82de7e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18975
diff
changeset
|
499 * |
31bdbb82de7e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18975
diff
changeset
|
500 * @param filename File to export the certificate to |
31bdbb82de7e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18975
diff
changeset
|
501 * @param crt Certificate to export |
31bdbb82de7e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18975
diff
changeset
|
502 * @return TRUE if the export succeeded, otherwise FALSE |
31bdbb82de7e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18975
diff
changeset
|
503 */ |
31bdbb82de7e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18975
diff
changeset
|
504 gboolean |
31bdbb82de7e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18975
diff
changeset
|
505 purple_certificate_export(const gchar *filename, PurpleCertificate *crt); |
31bdbb82de7e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18975
diff
changeset
|
506 |
31bdbb82de7e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18975
diff
changeset
|
507 |
31bdbb82de7e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18975
diff
changeset
|
508 /** |
18953
89b32569890c
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18952
diff
changeset
|
509 * Retrieves the certificate public key fingerprint using SHA1. |
89b32569890c
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18952
diff
changeset
|
510 * |
89b32569890c
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18952
diff
changeset
|
511 * @param crt Certificate instance |
89b32569890c
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18952
diff
changeset
|
512 * @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
|
513 * this. |
89b32569890c
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18952
diff
changeset
|
514 * @see purple_base16_encode_chunked() |
89b32569890c
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18952
diff
changeset
|
515 */ |
89b32569890c
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18952
diff
changeset
|
516 GByteArray * |
89b32569890c
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18952
diff
changeset
|
517 purple_certificate_get_fingerprint_sha1(PurpleCertificate *crt); |
89b32569890c
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18952
diff
changeset
|
518 |
19080
3bdede51c007
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19077
diff
changeset
|
519 /** |
3bdede51c007
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19077
diff
changeset
|
520 * Get a unique identifier for the certificate |
3bdede51c007
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19077
diff
changeset
|
521 * |
3bdede51c007
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19077
diff
changeset
|
522 * @param crt Certificate instance |
3bdede51c007
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19077
diff
changeset
|
523 * @return String representing the certificate uniquely. Must be g_free()'ed |
3bdede51c007
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19077
diff
changeset
|
524 */ |
3bdede51c007
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19077
diff
changeset
|
525 gchar * |
3bdede51c007
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19077
diff
changeset
|
526 purple_certificate_get_unique_id(PurpleCertificate *crt); |
3bdede51c007
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19077
diff
changeset
|
527 |
3bdede51c007
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19077
diff
changeset
|
528 /** |
3bdede51c007
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19077
diff
changeset
|
529 * Get a unique identifier for the certificate's issuer |
3bdede51c007
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19077
diff
changeset
|
530 * |
3bdede51c007
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19077
diff
changeset
|
531 * @param crt Certificate instance |
3bdede51c007
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19077
diff
changeset
|
532 * @return String representing the certificate's issuer uniquely. Must be |
3bdede51c007
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19077
diff
changeset
|
533 * g_free()'ed |
3bdede51c007
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19077
diff
changeset
|
534 */ |
3bdede51c007
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19077
diff
changeset
|
535 gchar * |
3bdede51c007
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19077
diff
changeset
|
536 purple_certificate_get_issuer_unique_id(PurpleCertificate *crt); |
18962
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
537 |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
538 /** |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
539 * 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
|
540 * |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
541 * 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
|
542 * 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
|
543 * |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
544 * @param crt Certificate instance |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
545 * @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
|
546 */ |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
547 gchar * |
fcd05c39803e
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18957
diff
changeset
|
548 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
|
549 |
19008
7fd9bd55f8d0
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
550 /** |
7fd9bd55f8d0
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
551 * Check the subject name against that on the certificate |
7fd9bd55f8d0
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
552 * @param crt Certificate instance |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22267
diff
changeset
|
553 * @param name Name to check. |
19008
7fd9bd55f8d0
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
554 * @return TRUE if it is a match, else FALSE |
7fd9bd55f8d0
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
555 */ |
7fd9bd55f8d0
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
556 gboolean |
7fd9bd55f8d0
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
557 purple_certificate_check_subject_name(PurpleCertificate *crt, const gchar *name); |
7fd9bd55f8d0
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
558 |
19012
b1090cbfc286
- Add expiration/activation functions for Certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19011
diff
changeset
|
559 /** |
b1090cbfc286
- Add expiration/activation functions for Certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19011
diff
changeset
|
560 * Get the expiration/activation times. |
b1090cbfc286
- Add expiration/activation functions for Certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19011
diff
changeset
|
561 * |
b1090cbfc286
- Add expiration/activation functions for Certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19011
diff
changeset
|
562 * @param crt Certificate instance |
b1090cbfc286
- Add expiration/activation functions for Certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19011
diff
changeset
|
563 * @param activation Reference to store the activation time at. May be NULL |
b1090cbfc286
- Add expiration/activation functions for Certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19011
diff
changeset
|
564 * if you don't actually want it. |
b1090cbfc286
- Add expiration/activation functions for Certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19011
diff
changeset
|
565 * @param expiration Reference to store the expiration time at. May be NULL |
b1090cbfc286
- Add expiration/activation functions for Certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19011
diff
changeset
|
566 * if you don't actually want it. |
b1090cbfc286
- Add expiration/activation functions for Certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19011
diff
changeset
|
567 * @return TRUE if the requested values were obtained, otherwise FALSE. |
b1090cbfc286
- Add expiration/activation functions for Certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19011
diff
changeset
|
568 */ |
b1090cbfc286
- Add expiration/activation functions for Certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19011
diff
changeset
|
569 gboolean |
b1090cbfc286
- Add expiration/activation functions for Certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19011
diff
changeset
|
570 purple_certificate_get_times(PurpleCertificate *crt, time_t *activation, time_t *expiration); |
19008
7fd9bd55f8d0
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
571 |
32414
7ceb5ca4b323
Add a function for retrieving the raw DER representation of a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32226
diff
changeset
|
572 /** |
7ceb5ca4b323
Add a function for retrieving the raw DER representation of a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32226
diff
changeset
|
573 * Retrieves the certificate data in DER form. |
7ceb5ca4b323
Add a function for retrieving the raw DER representation of a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32226
diff
changeset
|
574 * |
7ceb5ca4b323
Add a function for retrieving the raw DER representation of a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32226
diff
changeset
|
575 * @param crt Certificate instance |
7ceb5ca4b323
Add a function for retrieving the raw DER representation of a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32226
diff
changeset
|
576 * |
7ceb5ca4b323
Add a function for retrieving the raw DER representation of a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32226
diff
changeset
|
577 * @return Binary DER representation of the certificate - must be freed using |
7ceb5ca4b323
Add a function for retrieving the raw DER representation of a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32226
diff
changeset
|
578 * g_byte_array_free(). |
7ceb5ca4b323
Add a function for retrieving the raw DER representation of a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32226
diff
changeset
|
579 */ |
7ceb5ca4b323
Add a function for retrieving the raw DER representation of a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32226
diff
changeset
|
580 GByteArray * |
7ceb5ca4b323
Add a function for retrieving the raw DER representation of a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32226
diff
changeset
|
581 purple_certificate_get_der_data(PurpleCertificate *crt); |
7ceb5ca4b323
Add a function for retrieving the raw DER representation of a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32226
diff
changeset
|
582 |
18994
bf23d58ec9c3
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18989
diff
changeset
|
583 /*@}*/ |
bf23d58ec9c3
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18989
diff
changeset
|
584 |
bf23d58ec9c3
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18989
diff
changeset
|
585 /*****************************************************************************/ |
bf23d58ec9c3
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18989
diff
changeset
|
586 /** @name Certificate Pool Functions */ |
bf23d58ec9c3
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18989
diff
changeset
|
587 /*****************************************************************************/ |
bf23d58ec9c3
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18989
diff
changeset
|
588 /*@{*/ |
18984
2b4150624cf2
- Add purple_certificate_pool_mkpath helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18983
diff
changeset
|
589 /** |
2b4150624cf2
- Add purple_certificate_pool_mkpath helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18983
diff
changeset
|
590 * Helper function for generating file paths in ~/.purple/certificates for |
2b4150624cf2
- Add purple_certificate_pool_mkpath helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18983
diff
changeset
|
591 * CertificatePools that use them. |
2b4150624cf2
- Add purple_certificate_pool_mkpath helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18983
diff
changeset
|
592 * |
19010
0d4b84820390
- Fix overzealous escaping cause by ancestor revision
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19009
diff
changeset
|
593 * All components will be escaped for filesystem friendliness. |
0d4b84820390
- Fix overzealous escaping cause by ancestor revision
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19009
diff
changeset
|
594 * |
18984
2b4150624cf2
- Add purple_certificate_pool_mkpath helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18983
diff
changeset
|
595 * @param pool CertificatePool to build a path for |
2b4150624cf2
- Add purple_certificate_pool_mkpath helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18983
diff
changeset
|
596 * @param id Key to look up a Certificate by. May be NULL. |
2b4150624cf2
- Add purple_certificate_pool_mkpath helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18983
diff
changeset
|
597 * @return A newly allocated path of the form |
19010
0d4b84820390
- Fix overzealous escaping cause by ancestor revision
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19009
diff
changeset
|
598 * ~/.purple/certificates/scheme_name/pool_name/unique_id |
18984
2b4150624cf2
- Add purple_certificate_pool_mkpath helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18983
diff
changeset
|
599 */ |
2b4150624cf2
- Add purple_certificate_pool_mkpath helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18983
diff
changeset
|
600 gchar * |
2b4150624cf2
- Add purple_certificate_pool_mkpath helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18983
diff
changeset
|
601 purple_certificate_pool_mkpath(PurpleCertificatePool *pool, const gchar *id); |
2b4150624cf2
- Add purple_certificate_pool_mkpath helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18983
diff
changeset
|
602 |
18995
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
603 /** |
19034
8b627694bf4a
- Add purple_certificate_pool_usable to check whether a pool's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19028
diff
changeset
|
604 * Determines whether a pool can be used. |
8b627694bf4a
- Add purple_certificate_pool_usable to check whether a pool's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19028
diff
changeset
|
605 * |
8b627694bf4a
- Add purple_certificate_pool_usable to check whether a pool's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19028
diff
changeset
|
606 * Checks whether the associated CertificateScheme is loaded. |
8b627694bf4a
- Add purple_certificate_pool_usable to check whether a pool's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19028
diff
changeset
|
607 * |
8b627694bf4a
- Add purple_certificate_pool_usable to check whether a pool's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19028
diff
changeset
|
608 * @param pool Pool to check |
8b627694bf4a
- Add purple_certificate_pool_usable to check whether a pool's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19028
diff
changeset
|
609 * |
8b627694bf4a
- Add purple_certificate_pool_usable to check whether a pool's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19028
diff
changeset
|
610 * @return TRUE if the pool can be used, otherwise FALSE |
8b627694bf4a
- Add purple_certificate_pool_usable to check whether a pool's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19028
diff
changeset
|
611 */ |
8b627694bf4a
- Add purple_certificate_pool_usable to check whether a pool's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19028
diff
changeset
|
612 gboolean |
8b627694bf4a
- Add purple_certificate_pool_usable to check whether a pool's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19028
diff
changeset
|
613 purple_certificate_pool_usable(PurpleCertificatePool *pool); |
8b627694bf4a
- Add purple_certificate_pool_usable to check whether a pool's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19028
diff
changeset
|
614 |
8b627694bf4a
- Add purple_certificate_pool_usable to check whether a pool's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19028
diff
changeset
|
615 /** |
19060
c79b54f03f9d
- Add purple_certificate_pool_get_scheme helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19049
diff
changeset
|
616 * Looks up the scheme the pool operates under |
c79b54f03f9d
- Add purple_certificate_pool_get_scheme helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19049
diff
changeset
|
617 * |
c79b54f03f9d
- Add purple_certificate_pool_get_scheme helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19049
diff
changeset
|
618 * @param pool Pool to get the scheme of |
c79b54f03f9d
- Add purple_certificate_pool_get_scheme helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19049
diff
changeset
|
619 * |
c79b54f03f9d
- Add purple_certificate_pool_get_scheme helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19049
diff
changeset
|
620 * @return Pointer to the pool's scheme, or NULL if it isn't loaded. |
c79b54f03f9d
- Add purple_certificate_pool_get_scheme helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19049
diff
changeset
|
621 * @see purple_certificate_pool_usable() |
c79b54f03f9d
- Add purple_certificate_pool_get_scheme helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19049
diff
changeset
|
622 */ |
c79b54f03f9d
- Add purple_certificate_pool_get_scheme helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19049
diff
changeset
|
623 PurpleCertificateScheme * |
c79b54f03f9d
- Add purple_certificate_pool_get_scheme helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19049
diff
changeset
|
624 purple_certificate_pool_get_scheme(PurpleCertificatePool *pool); |
c79b54f03f9d
- Add purple_certificate_pool_get_scheme helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19049
diff
changeset
|
625 |
c79b54f03f9d
- Add purple_certificate_pool_get_scheme helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19049
diff
changeset
|
626 /** |
18995
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
627 * Check for presence of an ID in a pool. |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
628 * @param pool Pool to look in |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
629 * @param id ID to look for |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
630 * @return TRUE if the ID is in the pool, else FALSE |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
631 */ |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
632 gboolean |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
633 purple_certificate_pool_contains(PurpleCertificatePool *pool, const gchar *id); |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
634 |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
635 /** |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
636 * Retrieve a certificate from a pool. |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
637 * @param pool Pool to fish in |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
638 * @param id ID to look up |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
639 * @return Retrieved certificate, or NULL if it wasn't there |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
640 */ |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
641 PurpleCertificate * |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
642 purple_certificate_pool_retrieve(PurpleCertificatePool *pool, const gchar *id); |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
643 |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
644 /** |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
645 * Add a certificate to a pool |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
646 * |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
647 * Any pre-existing certificate of the same ID will be overwritten. |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
648 * |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
649 * @param pool Pool to add to |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
650 * @param id ID to store the certificate with |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
651 * @param crt Certificate to store |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
652 * @return TRUE if the operation succeeded, otherwise FALSE |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
653 */ |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
654 gboolean |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
655 purple_certificate_pool_store(PurpleCertificatePool *pool, const gchar *id, PurpleCertificate *crt); |
47b06daea9d1
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18994
diff
changeset
|
656 |
19026
b3acaf46d9ad
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19023
diff
changeset
|
657 /** |
19049
8cbc110456ac
- Add purple_certificate_pool_delete
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19034
diff
changeset
|
658 * Remove a certificate from a pool |
8cbc110456ac
- Add purple_certificate_pool_delete
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19034
diff
changeset
|
659 * |
8cbc110456ac
- Add purple_certificate_pool_delete
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19034
diff
changeset
|
660 * @param pool Pool to remove from |
8cbc110456ac
- Add purple_certificate_pool_delete
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19034
diff
changeset
|
661 * @param id ID to remove |
8cbc110456ac
- Add purple_certificate_pool_delete
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19034
diff
changeset
|
662 * @return TRUE if the operation succeeded, otherwise FALSE |
8cbc110456ac
- Add purple_certificate_pool_delete
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19034
diff
changeset
|
663 */ |
8cbc110456ac
- Add purple_certificate_pool_delete
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19034
diff
changeset
|
664 gboolean |
8cbc110456ac
- Add purple_certificate_pool_delete
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19034
diff
changeset
|
665 purple_certificate_pool_delete(PurpleCertificatePool *pool, const gchar *id); |
8cbc110456ac
- Add purple_certificate_pool_delete
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19034
diff
changeset
|
666 |
8cbc110456ac
- Add purple_certificate_pool_delete
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19034
diff
changeset
|
667 /** |
19026
b3acaf46d9ad
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19023
diff
changeset
|
668 * Get the list of IDs currently in the pool. |
b3acaf46d9ad
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19023
diff
changeset
|
669 * |
b3acaf46d9ad
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19023
diff
changeset
|
670 * @param pool Pool to enumerate |
b3acaf46d9ad
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19023
diff
changeset
|
671 * @return GList pointing to newly-allocated id strings. Free using |
b3acaf46d9ad
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19023
diff
changeset
|
672 * purple_certificate_pool_destroy_idlist() |
b3acaf46d9ad
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19023
diff
changeset
|
673 */ |
b3acaf46d9ad
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19023
diff
changeset
|
674 GList * |
b3acaf46d9ad
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19023
diff
changeset
|
675 purple_certificate_pool_get_idlist(PurpleCertificatePool *pool); |
b3acaf46d9ad
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19023
diff
changeset
|
676 |
b3acaf46d9ad
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19023
diff
changeset
|
677 /** |
b3acaf46d9ad
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19023
diff
changeset
|
678 * Destroys the result given by purple_certificate_pool_get_idlist() |
b3acaf46d9ad
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19023
diff
changeset
|
679 * |
b3acaf46d9ad
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19023
diff
changeset
|
680 * @param idlist ID List to destroy |
b3acaf46d9ad
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19023
diff
changeset
|
681 */ |
b3acaf46d9ad
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19023
diff
changeset
|
682 void |
b3acaf46d9ad
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19023
diff
changeset
|
683 purple_certificate_pool_destroy_idlist(GList *idlist); |
b3acaf46d9ad
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19023
diff
changeset
|
684 |
18945
fa42d8fa7873
- Documentation segmentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18942
diff
changeset
|
685 /*@}*/ |
fa42d8fa7873
- Documentation segmentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18942
diff
changeset
|
686 |
17910
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
687 /*****************************************************************************/ |
18994
bf23d58ec9c3
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18989
diff
changeset
|
688 /** @name Certificate Subsystem API */ |
17910
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
689 /*****************************************************************************/ |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
690 /*@{*/ |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
691 |
18950
f78a9efa9eaf
- Add purple_certificate_register_builtins
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18947
diff
changeset
|
692 /** |
18957
9205841eed06
- Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18953
diff
changeset
|
693 * Initialize the certificate system |
18950
f78a9efa9eaf
- Add purple_certificate_register_builtins
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18947
diff
changeset
|
694 */ |
f78a9efa9eaf
- Add purple_certificate_register_builtins
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18947
diff
changeset
|
695 void |
18957
9205841eed06
- Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18953
diff
changeset
|
696 purple_certificate_init(void); |
9205841eed06
- Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18953
diff
changeset
|
697 |
9205841eed06
- Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18953
diff
changeset
|
698 /** |
9205841eed06
- Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18953
diff
changeset
|
699 * 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
|
700 */ |
9205841eed06
- Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18953
diff
changeset
|
701 void |
9205841eed06
- Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18953
diff
changeset
|
702 purple_certificate_uninit(void); |
18950
f78a9efa9eaf
- Add purple_certificate_register_builtins
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18947
diff
changeset
|
703 |
19022
1f07f96dc1ce
- Add purple_certificate_get_handle
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19021
diff
changeset
|
704 /** |
1f07f96dc1ce
- Add purple_certificate_get_handle
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19021
diff
changeset
|
705 * Get the Certificate subsystem handle for signalling purposes |
1f07f96dc1ce
- Add purple_certificate_get_handle
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19021
diff
changeset
|
706 */ |
1f07f96dc1ce
- Add purple_certificate_get_handle
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19021
diff
changeset
|
707 gpointer |
1f07f96dc1ce
- Add purple_certificate_get_handle
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19021
diff
changeset
|
708 purple_certificate_get_handle(void); |
1f07f96dc1ce
- Add purple_certificate_get_handle
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19021
diff
changeset
|
709 |
18192
dc7e7b8bdc8c
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18190
diff
changeset
|
710 /** 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
|
711 * @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
|
712 * @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
|
713 */ |
dc7e7b8bdc8c
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18190
diff
changeset
|
714 PurpleCertificateScheme * |
dc7e7b8bdc8c
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18190
diff
changeset
|
715 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
|
716 |
19023
eb86ff3ba21a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
717 /** |
eb86ff3ba21a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
718 * Get all registered CertificateSchemes |
eb86ff3ba21a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
719 * |
19028
86403f33720b
- Add dire warnings to the purple_certificate_get_Xs docs
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19026
diff
changeset
|
720 * @return GList pointing to all registered CertificateSchemes . This value |
86403f33720b
- Add dire warnings to the purple_certificate_get_Xs docs
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19026
diff
changeset
|
721 * is owned by libpurple |
19023
eb86ff3ba21a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
722 */ |
eb86ff3ba21a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
723 GList * |
eb86ff3ba21a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
724 purple_certificate_get_schemes(void); |
eb86ff3ba21a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
725 |
18192
dc7e7b8bdc8c
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18190
diff
changeset
|
726 /** Register a CertificateScheme with libpurple |
dc7e7b8bdc8c
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18190
diff
changeset
|
727 * |
dc7e7b8bdc8c
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18190
diff
changeset
|
728 * 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
|
729 * that. |
dc7e7b8bdc8c
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18190
diff
changeset
|
730 * |
dc7e7b8bdc8c
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18190
diff
changeset
|
731 * @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
|
732 * @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
|
733 */ |
dc7e7b8bdc8c
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18190
diff
changeset
|
734 gboolean |
dc7e7b8bdc8c
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18190
diff
changeset
|
735 purple_certificate_register_scheme(PurpleCertificateScheme *scheme); |
dc7e7b8bdc8c
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18190
diff
changeset
|
736 |
18926
8c4d52bc0319
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18192
diff
changeset
|
737 /** Unregister a CertificateScheme from libpurple |
8c4d52bc0319
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18192
diff
changeset
|
738 * |
8c4d52bc0319
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18192
diff
changeset
|
739 * @param scheme Scheme to unregister. |
8c4d52bc0319
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18192
diff
changeset
|
740 * If the scheme is not registered, this is a no-op. |
8c4d52bc0319
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18192
diff
changeset
|
741 * |
8c4d52bc0319
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18192
diff
changeset
|
742 * @return TRUE if the unregister completed successfully |
8c4d52bc0319
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18192
diff
changeset
|
743 */ |
8c4d52bc0319
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18192
diff
changeset
|
744 gboolean |
8c4d52bc0319
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18192
diff
changeset
|
745 purple_certificate_unregister_scheme(PurpleCertificateScheme *scheme); |
8c4d52bc0319
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18192
diff
changeset
|
746 |
18941
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
747 /** Look up a registered PurpleCertificateVerifier by scheme and name |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
748 * @param scheme_name Scheme name. Case insensitive. |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
749 * @param ver_name The verifier name. Case insensitive. |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
750 * @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
|
751 */ |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
752 PurpleCertificateVerifier * |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
753 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
|
754 |
19023
eb86ff3ba21a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
755 /** |
eb86ff3ba21a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
756 * Get the list of registered CertificateVerifiers |
eb86ff3ba21a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
757 * |
19028
86403f33720b
- Add dire warnings to the purple_certificate_get_Xs docs
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19026
diff
changeset
|
758 * @return GList of all registered PurpleCertificateVerifier. This value |
86403f33720b
- Add dire warnings to the purple_certificate_get_Xs docs
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19026
diff
changeset
|
759 * is owned by libpurple |
19023
eb86ff3ba21a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
760 */ |
eb86ff3ba21a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
761 GList * |
eb86ff3ba21a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
762 purple_certificate_get_verifiers(void); |
18941
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
763 |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
764 /** |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
765 * Register a CertificateVerifier with libpurple |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
766 * |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
767 * @param vr Verifier to register. |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
768 * @return TRUE if register succeeded, otherwise FALSE |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
769 */ |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
770 gboolean |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
771 purple_certificate_register_verifier(PurpleCertificateVerifier *vr); |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
772 |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
773 /** |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
774 * Unregister a CertificateVerifier with libpurple |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
775 * |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
776 * @param vr Verifier to unregister. |
18971
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
777 * @return TRUE if unregister succeeded, otherwise FALSE |
18941
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
778 */ |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
779 gboolean |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
780 purple_certificate_unregister_verifier(PurpleCertificateVerifier *vr); |
425f494bd1ec
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18940
diff
changeset
|
781 |
18971
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
782 /** Look up a registered PurpleCertificatePool by scheme and name |
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
783 * @param scheme_name Scheme name. Case insensitive. |
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
784 * @param pool_name Pool name. Case insensitive. |
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
785 * @return Pointer to the located Pool, or NULL if it isn't found. |
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
786 */ |
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
787 PurpleCertificatePool * |
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
788 purple_certificate_find_pool(const gchar *scheme_name, const gchar *pool_name); |
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
789 |
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
790 /** |
19023
eb86ff3ba21a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
791 * Get the list of registered Pools |
eb86ff3ba21a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
792 * |
19028
86403f33720b
- Add dire warnings to the purple_certificate_get_Xs docs
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19026
diff
changeset
|
793 * @return GList of all registered PurpleCertificatePool s. This value |
86403f33720b
- Add dire warnings to the purple_certificate_get_Xs docs
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19026
diff
changeset
|
794 * is owned by libpurple |
19023
eb86ff3ba21a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
795 */ |
eb86ff3ba21a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
796 GList * |
eb86ff3ba21a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
797 purple_certificate_get_pools(void); |
eb86ff3ba21a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
798 |
eb86ff3ba21a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
799 /** |
18971
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
800 * Register a CertificatePool with libpurple and call its init function |
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
801 * |
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
802 * @param pool Pool to register. |
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
803 * @return TRUE if the register succeeded, otherwise FALSE |
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
804 */ |
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
805 gboolean |
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
806 purple_certificate_register_pool(PurpleCertificatePool *pool); |
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
807 |
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
808 /** |
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
809 * Unregister a CertificatePool with libpurple and call its uninit function |
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
810 * |
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
811 * @param pool Pool to unregister. |
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
812 * @return TRUE if the unregister succeeded, otherwise FALSE |
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
813 */ |
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
814 gboolean |
898e2bd70f23
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18970
diff
changeset
|
815 purple_certificate_unregister_pool(PurpleCertificatePool *pool); |
17910
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
816 |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
817 /*@}*/ |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
818 |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
819 |
19329
e93db0c87b26
- Add purple_certificate_display_x509
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19092
diff
changeset
|
820 /** |
e93db0c87b26
- Add purple_certificate_display_x509
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19092
diff
changeset
|
821 * Displays a window showing X.509 certificate information |
e93db0c87b26
- Add purple_certificate_display_x509
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19092
diff
changeset
|
822 * |
e93db0c87b26
- Add purple_certificate_display_x509
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19092
diff
changeset
|
823 * @param crt Certificate under an "x509" Scheme |
20927
3d704e6bd08a
s/@TODO/@todo/ for Doxygen.
Richard Laager <rlaager@wiktel.com>
parents:
20875
diff
changeset
|
824 * @todo Will break on CA certs, as they have no Common Name |
19329
e93db0c87b26
- Add purple_certificate_display_x509
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19092
diff
changeset
|
825 */ |
e93db0c87b26
- Add purple_certificate_display_x509
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19092
diff
changeset
|
826 void |
e93db0c87b26
- Add purple_certificate_display_x509
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19092
diff
changeset
|
827 purple_certificate_display_x509(PurpleCertificate *crt); |
e93db0c87b26
- Add purple_certificate_display_x509
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19092
diff
changeset
|
828 |
21647
a57adf1de9cb
Patch from Florian Quze (the InstantBird dude) to add a search path for
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20927
diff
changeset
|
829 /** |
a57adf1de9cb
Patch from Florian Quze (the InstantBird dude) to add a search path for
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20927
diff
changeset
|
830 * Add a search path for certificates. |
a57adf1de9cb
Patch from Florian Quze (the InstantBird dude) to add a search path for
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20927
diff
changeset
|
831 * |
a57adf1de9cb
Patch from Florian Quze (the InstantBird dude) to add a search path for
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20927
diff
changeset
|
832 * @param path Path to search for certificates. |
a57adf1de9cb
Patch from Florian Quze (the InstantBird dude) to add a search path for
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20927
diff
changeset
|
833 */ |
a57adf1de9cb
Patch from Florian Quze (the InstantBird dude) to add a search path for
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20927
diff
changeset
|
834 void purple_certificate_add_ca_search_path(const char *path); |
19329
e93db0c87b26
- Add purple_certificate_display_x509
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19092
diff
changeset
|
835 |
17910
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
836 #ifdef __cplusplus |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
837 } |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
838 #endif /* __cplusplus */ |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
839 |
668a294f9a72
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
840 #endif /* _PURPLE_CERTIFICATE_H */ |