certificate.h
Go to the documentation of this file.
1 
8 /*
9  *
10  * purple
11  *
12  * Purple is the legal property of its developers, whose names are too numerous
13  * to list here. Please refer to the COPYRIGHT file distributed with this
14  * source distribution.
15  *
16  * This program is free software; you can redistribute it and/or modify
17  * it under the terms of the GNU General Public License as published by
18  * the Free Software Foundation; either version 2 of the License, or
19  * (at your option) any later version.
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24  * GNU General Public License for more details.
25  *
26  * You should have received a copy of the GNU General Public License
27  * along with this program; if not, write to the Free Software
28  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
29  */
30 
31 #ifndef _PURPLE_CERTIFICATE_H
32 #define _PURPLE_CERTIFICATE_H
33 
34 #include <time.h>
35 
36 #include <glib.h>
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif /* __cplusplus */
41 
42 
43 typedef enum
44 {
45  PURPLE_CERTIFICATE_INVALID = 0,
46  PURPLE_CERTIFICATE_VALID = 1
47 } PurpleCertificateVerificationStatus;
48 
54 
61  (PurpleCertificateVerificationStatus st,
62  gpointer userdata);
63 
70 {
74  gpointer data;
75 };
76 
84 {
86  gchar *scheme_name;
88  gchar *name;
89 
95  gchar *fullname;
96 
98  gpointer data;
99 
107  gboolean (* init)(void);
108 
114  void (* uninit)(void);
115 
117  gboolean (* cert_in_pool)(const gchar *id);
119  PurpleCertificate * (* get_cert)(const gchar *id);
124  gboolean (* put_cert)(const gchar *id, PurpleCertificate *crt);
126  gboolean (* delete_cert)(const gchar *id);
127 
129  GList * (* get_idlist)(void);
130 
131  void (*_purple_reserved1)(void);
132  void (*_purple_reserved2)(void);
133  void (*_purple_reserved3)(void);
134  void (*_purple_reserved4)(void);
135 };
136 
146 {
152  gchar * name;
153 
159  gchar * fullname;
160 
167  PurpleCertificate * (* import_certificate)(const gchar * filename);
168 
177  gboolean (* export_certificate)(const gchar *filename, PurpleCertificate *crt);
178 
187  PurpleCertificate * (* copy_certificate)(PurpleCertificate *crt);
188 
199 
202  gboolean (*signed_by)(PurpleCertificate *crt, PurpleCertificate *issuer);
210  GByteArray * (* get_fingerprint_sha1)(PurpleCertificate *crt);
211 
219  gchar * (* get_unique_id)(PurpleCertificate *crt);
220 
228  gchar * (* get_issuer_unique_id)(PurpleCertificate *crt);
229 
241  gchar * (* get_subject_name)(PurpleCertificate *crt);
242 
248  gboolean (* check_subject_name)(PurpleCertificate *crt, const gchar *name);
249 
251  gboolean (* get_times)(PurpleCertificate *crt, time_t *activation, time_t *expiration);
252 
259  GSList * (* import_certificates)(const gchar * filename);
260 
261  void (*_purple_reserved1)(void);
262  void (*_purple_reserved2)(void);
263  void (*_purple_reserved3)(void);
264 };
265 
276 {
282  gchar *scheme_name;
283 
285  gchar *name;
286 
298 
308 
309  void (*_purple_reserved1)(void);
310  void (*_purple_reserved2)(void);
311  void (*_purple_reserved3)(void);
312  void (*_purple_reserved4)(void);
313 };
314 
321 {
329 
335  gchar *subject_name;
336 
342  GList *cert_chain;
343 
345  gpointer data;
346 
350  gpointer cb_data;
351 };
352 
353 /*****************************************************************************/
355 /*****************************************************************************/
381 void
383  const gchar *subject_name, GList *cert_chain,
385  gpointer cb_data);
386 
394 void
396  PurpleCertificateVerificationStatus st);
397 
400 /*****************************************************************************/
402 /*****************************************************************************/
413 
420 GList *
421 purple_certificate_copy_list(GList *crt_list);
422 
428 void
430 
436 void
437 purple_certificate_destroy_list (GList * crt_list);
438 
449 gboolean
451 
470 gboolean
472  PurpleCertificate **failing);
473 
488 gboolean
490 
499 purple_certificate_import(PurpleCertificateScheme *scheme, const gchar *filename);
500 
508 GSList *
509 purple_certificates_import(PurpleCertificateScheme *scheme, const gchar *filename);
510 
518 gboolean
519 purple_certificate_export(const gchar *filename, PurpleCertificate *crt);
520 
521 
530 GByteArray *
532 
539 gchar *
541 
549 gchar *
551 
561 gchar *
563 
570 gboolean
572 
583 gboolean
584 purple_certificate_get_times(PurpleCertificate *crt, time_t *activation, time_t *expiration);
585 
588 /*****************************************************************************/
590 /*****************************************************************************/
603 gchar *
605 
615 gboolean
617 
628 
635 gboolean
637 
646 
657 gboolean
659 
667 gboolean
669 
677 GList *
679 
685 void
687 
690 /*****************************************************************************/
692 /*****************************************************************************/
698 void
700 
704 void
706 
710 gpointer
712 
718 purple_certificate_find_scheme(const gchar *name);
719 
726 GList *
728 
737 gboolean
739 
747 gboolean
749 
756 purple_certificate_find_verifier(const gchar *scheme_name, const gchar *ver_name);
757 
764 GList *
766 
773 gboolean
775 
782 gboolean
784 
791 purple_certificate_find_pool(const gchar *scheme_name, const gchar *pool_name);
792 
799 GList *
801 
808 gboolean
810 
817 gboolean
819 
829 void
831 
837 void purple_certificate_add_ca_search_path(const char *path);
838 
839 #ifdef __cplusplus
840 }
841 #endif /* __cplusplus */
842 
843 #endif /* _PURPLE_CERTIFICATE_H */