minimal build
[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_INSIDE_HEADER__) && !defined (GCR_COMPILATION)
23 #error "Only <gcr/gcr.h> or <gcr/gcr-base.h> can be included directly."
24 #endif
25
26 #ifndef __GCR_TRUST_H__
27 #define __GCR_TRUST_H__
28
29 #include "gcr-certificate.h"
30 #include "gcr-types.h"
31
32 G_BEGIN_DECLS
33
34 #define GCR_PURPOSE_SERVER_AUTH "1.3.6.1.5.5.7.3.1"
35 #define GCR_PURPOSE_CLIENT_AUTH "1.3.6.1.5.5.7.3.2"
36 #define GCR_PURPOSE_CODE_SIGNING "1.3.6.1.5.5.7.3.3"
37 #define GCR_PURPOSE_EMAIL "1.3.6.1.5.5.7.3.4"
38
39 gboolean       gcr_trust_is_certificate_pinned                 (GcrCertificate *certificate,
40                                                                 const gchar *purpose,
41                                                                 const gchar *peer,
42                                                                 GCancellable *cancellable,
43                                                                 GError **error);
44
45 void           gcr_trust_is_certificate_pinned_async           (GcrCertificate *certificate,
46                                                                 const gchar *purpose,
47                                                                 const gchar *peer,
48                                                                 GCancellable *cancellable,
49                                                                 GAsyncReadyCallback callback,
50                                                                 gpointer user_data);
51
52 gboolean       gcr_trust_is_certificate_pinned_finish          (GAsyncResult *result,
53                                                                 GError **error);
54
55 gboolean       gcr_trust_add_pinned_certificate                (GcrCertificate *certificate,
56                                                                 const gchar *purpose,
57                                                                 const gchar *peer,
58                                                                 GCancellable *cancellable,
59                                                                 GError **error);
60
61 void           gcr_trust_add_pinned_certificate_async          (GcrCertificate *certificate,
62                                                                 const gchar *purpose,
63                                                                 const gchar *peer,
64                                                                 GCancellable *cancellable,
65                                                                 GAsyncReadyCallback callback,
66                                                                 gpointer user_data);
67
68 gboolean       gcr_trust_add_pinned_certificate_finish         (GAsyncResult *result,
69                                                                 GError **error);
70
71 gboolean       gcr_trust_remove_pinned_certificate             (GcrCertificate *certificate,
72                                                                 const gchar *purpose,
73                                                                 const gchar *peer,
74                                                                 GCancellable *cancellable,
75                                                                 GError **error);
76
77 void           gcr_trust_remove_pinned_certificate_async       (GcrCertificate *certificate,
78                                                                 const gchar *purpose,
79                                                                 const gchar *peer,
80                                                                 GCancellable *cancellable,
81                                                                 GAsyncReadyCallback callback,
82                                                                 gpointer user_data);
83
84 gboolean       gcr_trust_remove_pinned_certificate_finish      (GAsyncResult *result,
85                                                                 GError **error);
86
87 gboolean       gcr_trust_is_certificate_anchored               (GcrCertificate *certificate,
88                                                                 const gchar *purpose,
89                                                                 GCancellable *cancellable,
90                                                                 GError **error);
91
92 void           gcr_trust_is_certificate_anchored_async         (GcrCertificate *certificate,
93                                                                 const gchar *purpose,
94                                                                 GCancellable *cancellable,
95                                                                 GAsyncReadyCallback callback,
96                                                                 gpointer user_data);
97
98 gboolean       gcr_trust_is_certificate_anchored_finish        (GAsyncResult *result,
99                                                                 GError **error);
100
101 G_END_DECLS
102
103 #endif /* __GCR_TOKEN_MANAGER_H__ */