]> git.0d.be Git - empathy.git/blob - libempathy/empathy-tls-verifier.h
2f66acb9c97f861cb3c91f0b7371e30e8c457a1b
[empathy.git] / libempathy / empathy-tls-verifier.h
1 /*
2  * empathy-tls-verifier.h - Header for EmpathyTLSVerifier
3  * Copyright (C) 2010 Collabora Ltd.
4  * @author Cosimo Cecchi <cosimo.cecchi@collabora.co.uk>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  */
20
21 #ifndef __EMPATHY_TLS_VERIFIER_H__
22 #define __EMPATHY_TLS_VERIFIER_H__
23
24 #include <glib-object.h>
25 #include <gio/gio.h>
26
27 #include <telepathy-glib/telepathy-glib.h>
28
29 G_BEGIN_DECLS
30
31 typedef struct _EmpathyTLSVerifier EmpathyTLSVerifier;
32 typedef struct _EmpathyTLSVerifierClass EmpathyTLSVerifierClass;
33
34 struct _EmpathyTLSVerifierClass {
35     GObjectClass parent_class;
36 };
37
38 struct _EmpathyTLSVerifier {
39     GObject parent;
40     gpointer priv;
41 };
42
43 GType empathy_tls_verifier_get_type (void);
44
45 #define EMPATHY_TYPE_TLS_VERIFIER \
46   (empathy_tls_verifier_get_type ())
47 #define EMPATHY_TLS_VERIFIER(obj) \
48   (G_TYPE_CHECK_INSTANCE_CAST((obj), EMPATHY_TYPE_TLS_VERIFIER, \
49     EmpathyTLSVerifier))
50 #define EMPATHY_TLS_VERIFIER_CLASS(klass) \
51   (G_TYPE_CHECK_CLASS_CAST((klass), EMPATHY_TYPE_TLS_VERIFIER, \
52   EmpathyTLSVerifierClass))
53 #define EMPATHY_IS_TLS_VERIFIER(obj) \
54   (G_TYPE_CHECK_INSTANCE_TYPE((obj), EMPATHY_TYPE_TLS_VERIFIER))
55 #define EMPATHY_IS_TLS_VERIFIER_CLASS(klass) \
56   (G_TYPE_CHECK_CLASS_TYPE((klass), EMPATHY_TYPE_TLS_VERIFIER))
57 #define EMPATHY_TLS_VERIFIER_GET_CLASS(obj) \
58   (G_TYPE_INSTANCE_GET_CLASS ((obj), EMPATHY_TYPE_TLS_VERIFIER, \
59   EmpathyTLSVerifierClass))
60
61 EmpathyTLSVerifier * empathy_tls_verifier_new (
62     TpTLSCertificate *certificate,
63     const gchar *hostname,
64     const gchar **reference_identities);
65
66 void empathy_tls_verifier_verify_async (EmpathyTLSVerifier *self,
67     GAsyncReadyCallback callback,
68     gpointer user_data);
69
70 gboolean empathy_tls_verifier_verify_finish (EmpathyTLSVerifier *self,
71     GAsyncResult *res,
72     TpTLSCertificateRejectReason *reason,
73     GHashTable **details,
74     GError **error);
75
76 void empathy_tls_verifier_store_exception (EmpathyTLSVerifier *self);
77
78 G_END_DECLS
79
80 #endif /* #ifndef __EMPATHY_TLS_VERIFIER_H__*/