[gcr] Complete tests of gcr_trust_xxx functionality.
[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 #ifndef __GCR_TRUST_H__
23 #define __GCR_TRUST_H__
24
25 #include "gcr-types.h"
26
27 G_BEGIN_DECLS
28
29 #define GCR_PURPOSE_SERVER_AUTH "1.3.6.1.5.5.7.3.1"
30 #define GCR_PURPOSE_CLIENT_AUTH "1.3.6.1.5.5.7.3.2"
31 #define GCR_PURPOSE_CODE_SIGNING "1.3.6.1.5.5.7.3.3"
32 #define GCR_PURPOSE_EMAIL "1.3.6.1.5.5.7.3.4"
33
34 gboolean       gcr_trust_is_certificate_exception              (GcrCertificate *cert,
35                                                                 const gchar *purpose,
36                                                                 const gchar *peer,
37                                                                 GCancellable *cancel,
38                                                                 GError **error);
39
40 void           gcr_trust_is_certificate_exception_async        (GcrCertificate *cert,
41                                                                 const gchar *purpose,
42                                                                 const gchar *peer,
43                                                                 GCancellable *cancel,
44                                                                 GAsyncReadyCallback callback,
45                                                                 gpointer user_data);
46
47 gboolean       gcr_trust_is_certificate_exception_finish       (GAsyncResult *res,
48                                                                 GError **error);
49
50 gboolean       gcr_trust_add_certificate_exception             (GcrCertificate *cert,
51                                                                 const gchar *purpose,
52                                                                 const gchar *peer,
53                                                                 GCancellable *cancel,
54                                                                 GError **error);
55
56 void           gcr_trust_add_certificate_exception_async       (GcrCertificate *cert,
57                                                                 const gchar *purpose,
58                                                                 const gchar *peer,
59                                                                 GCancellable *cancel,
60                                                                 GAsyncReadyCallback callback,
61                                                                 gpointer user_data);
62
63 gboolean       gcr_trust_add_certificate_exception_finish      (GAsyncResult *res,
64                                                                 GError **error);
65
66 gboolean       gcr_trust_remove_certificate_exception          (GcrCertificate *cert,
67                                                                 const gchar *purpose,
68                                                                 const gchar *peer,
69                                                                 GCancellable *cancel,
70                                                                 GError **error);
71
72 void           gcr_trust_remove_certificate_exception_async    (GcrCertificate *cert,
73                                                                 const gchar *purpose,
74                                                                 const gchar *peer,
75                                                                 GCancellable *cancel,
76                                                                 GAsyncReadyCallback callback,
77                                                                 gpointer user_data);
78
79 gboolean       gcr_trust_remove_certificate_exception_finish   (GAsyncResult *res,
80                                                                 GError **error);
81
82 gboolean       gcr_trust_is_certificate_anchor                 (GcrCertificate *cert,
83                                                                 const gchar *purpose,
84                                                                 GCancellable *cancel,
85                                                                 GError **error);
86
87 void           gcr_trust_is_certificate_anchor_async           (GcrCertificate *cert,
88                                                                 const gchar *purpose,
89                                                                 GCancellable *cancel,
90                                                                 GAsyncReadyCallback callback,
91                                                                 gpointer user_data);
92
93 gboolean       gcr_trust_is_certificate_anchor_finish          (GAsyncResult *res,
94                                                                 GError **error);
95
96 G_END_DECLS
97
98 #endif /* __GCR_TOKEN_MANAGER_H__ */