53ff770f8dad80f998dd9c34052ef59b9330d3ea
[platform/upstream/gcr.git] / gcr / gcr-trust.h
1 /*
2  * gnome-keyring
3  *
4  * Copyright (C) 2010 Stefan Walter
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as
8  * published by the Free Software Foundation; either version 2.1 of
9  * the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but
12  * 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 program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19  * 02111-1307, USA.
20  */
21
22 #if !defined (__GCR_H_INSIDE__) && !defined (GCR_COMPILATION)
23 #error "Only <gcr/gcr.h> can be included directly."
24 #endif
25
26 #ifndef __GCR_TRUST_H__
27 #define __GCR_TRUST_H__
28
29 #include "gcr-types.h"
30
31 G_BEGIN_DECLS
32
33 #define GCR_PURPOSE_SERVER_AUTH "1.3.6.1.5.5.7.3.1"
34 #define GCR_PURPOSE_CLIENT_AUTH "1.3.6.1.5.5.7.3.2"
35 #define GCR_PURPOSE_CODE_SIGNING "1.3.6.1.5.5.7.3.3"
36 #define GCR_PURPOSE_EMAIL "1.3.6.1.5.5.7.3.4"
37
38 gboolean       gcr_trust_is_certificate_exception              (GcrCertificate *certificate,
39                                                                 const gchar *purpose,
40                                                                 const gchar *peer,
41                                                                 GCancellable *cancellable,
42                                                                 GError **error);
43
44 void           gcr_trust_is_certificate_exception_async        (GcrCertificate *certificate,
45                                                                 const gchar *purpose,
46                                                                 const gchar *peer,
47                                                                 GCancellable *cancellable,
48                                                                 GAsyncReadyCallback callback,
49                                                                 gpointer user_data);
50
51 gboolean       gcr_trust_is_certificate_exception_finish       (GAsyncResult *result,
52                                                                 GError **error);
53
54 gboolean       gcr_trust_add_certificate_exception             (GcrCertificate *certificate,
55                                                                 const gchar *purpose,
56                                                                 const gchar *peer,
57                                                                 GCancellable *cancellable,
58                                                                 GError **error);
59
60 void           gcr_trust_add_certificate_exception_async       (GcrCertificate *certificate,
61                                                                 const gchar *purpose,
62                                                                 const gchar *peer,
63                                                                 GCancellable *cancellable,
64                                                                 GAsyncReadyCallback callback,
65                                                                 gpointer user_data);
66
67 gboolean       gcr_trust_add_certificate_exception_finish      (GAsyncResult *result,
68                                                                 GError **error);
69
70 gboolean       gcr_trust_remove_certificate_exception          (GcrCertificate *certificate,
71                                                                 const gchar *purpose,
72                                                                 const gchar *peer,
73                                                                 GCancellable *cancellable,
74                                                                 GError **error);
75
76 void           gcr_trust_remove_certificate_exception_async    (GcrCertificate *certificate,
77                                                                 const gchar *purpose,
78                                                                 const gchar *peer,
79                                                                 GCancellable *cancellable,
80                                                                 GAsyncReadyCallback callback,
81                                                                 gpointer user_data);
82
83 gboolean       gcr_trust_remove_certificate_exception_finish   (GAsyncResult *result,
84                                                                 GError **error);
85
86 gboolean       gcr_trust_is_certificate_anchor                 (GcrCertificate *certificate,
87                                                                 const gchar *purpose,
88                                                                 GCancellable *cancellable,
89                                                                 GError **error);
90
91 void           gcr_trust_is_certificate_anchor_async           (GcrCertificate *certificate,
92                                                                 const gchar *purpose,
93                                                                 GCancellable *cancellable,
94                                                                 GAsyncReadyCallback callback,
95                                                                 gpointer user_data);
96
97 gboolean       gcr_trust_is_certificate_anchor_finish          (GAsyncResult *result,
98                                                                 GError **error);
99
100 G_END_DECLS
101
102 #endif /* __GCR_TOKEN_MANAGER_H__ */