Merge branch 'master' into trust-store
[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 typedef enum _GcrTrust {
30         GCR_TRUST_UNTRUSTED = -1,
31         GCR_TRUST_UNKNOWN = 0,
32         GCR_TRUST_TRUSTED,
33 } GcrTrust;
34
35 typedef enum _GcrPurpose {
36         GCR_PURPOSE_SERVER_AUTH = 1,
37         GCR_PURPOSE_CLIENT_AUTH,
38         GCR_PURPOSE_CODE_SIGNING,
39         GCR_PURPOSE_EMAIL,
40         GCR_PURPOSE_TIME_STAMPING,
41         GCR_PURPOSE_IPSEC_ENDPOINT,
42         GCR_PURPOSE_IPSEC_TUNNEL,
43         GCR_PURPOSE_IPSEC_USER,
44         GCR_PURPOSE_IKE_INTERMEDIATE,
45 } GcrPurpose;
46
47 GcrTrust       gcr_trust_get_certificate_exception          (GcrCertificate *cert,
48                                                              GcrPurpose purpose,
49                                                              GCancellable *cancel,
50                                                              GError **error);
51
52 void           gcr_trust_get_certificate_exception_async    (GcrCertificate *cert,
53                                                              GcrPurpose purpose,
54                                                              GCancellable *cancel,
55                                                              GAsyncReadyCallback callback,
56                                                              gpointer user_data);
57
58 GcrTrust       gcr_trust_get_certificate_exception_finish   (GAsyncResult *res,
59                                                              GError **error);
60
61 gboolean       gcr_trust_set_certificate_exception          (GcrCertificate *cert,
62                                                              GcrPurpose purpose,
63                                                              GcrTrust trust,
64                                                              GCancellable *cancel,
65                                                              GError **error);
66
67 void           gcr_trust_set_certificate_exception_async    (GcrCertificate *cert,
68                                                              GcrPurpose purpose,
69                                                              GcrTrust trust,
70                                                              GCancellable *cancel,
71                                                              GAsyncReadyCallback callback,
72                                                              gpointer user_data);
73
74 gboolean       gcr_trust_set_certificate_exception_finish   (GAsyncResult *res,
75                                                              GError **error);
76
77 gboolean       gcr_trust_is_certificate_root                (GcrCertificate *cert,
78                                                              GcrPurpose purpose,
79                                                              GCancellable *cancel,
80                                                              GError **error);
81
82 void           gcr_trust_is_certificate_root_async          (GcrCertificate *cert,
83                                                              GcrPurpose purpose,
84                                                              GCancellable *cancel,
85                                                              GAsyncReadyCallback callback,
86                                                              gpointer user_data);
87
88 gboolean       gcr_trust_is_certificate_root_finish         (GAsyncResult *res,
89                                                              GError **error);
90
91 G_END_DECLS
92
93 #endif /* __GCR_TOKEN_MANAGER_H__ */