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