peer to peer dbus support added
[platform/upstream/libgsignon-glib.git] / libsignon-glib / signon-security-context.h
1 /* vi: set et sw=4 ts=4 cino=t0,(0: */
2 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 /*
4  * This file is part of libsignon-glib
5  *
6  * Copyright (C) 2012 Intel Corporation.
7  *
8  * Contact: Jussi Laako <jussi.laako@linux.intel.com>
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public License
12  * version 2.1 as published by the Free Software Foundation.
13  *
14  * This library is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22  * 02110-1301 USA
23  */
24
25 #ifndef _SIGNON_SECURITY_CONTEXT_H_
26 #define _SIGNON_SECURITY_CONTEXT_H_
27
28 #include <glib.h>
29
30 G_BEGIN_DECLS
31
32 /**
33  * Security context descriptor.
34  *
35  * Practically a string tuple.
36  *
37  * @sys_ctx: system context, such as SMACK-label, MSSF token or just a
38  *           binary path.
39  * @app_ctx: application context, such as a script or a web page.
40  */
41 typedef struct _SignonSecurityContext
42 {
43     gchar *sys_ctx;
44     gchar *app_ctx;
45 } SignonSecurityContext;
46
47 /**
48  * GList of #SignonSecurityContext items.
49  */
50 typedef GList SignonSecurityContextList;
51
52 SignonSecurityContext * signon_security_context_new ();
53 SignonSecurityContext * signon_security_context_new_from_values (
54                                             const gchar *system_context,
55                                             const gchar *application_context);
56 void signon_security_context_free (SignonSecurityContext *ctx);
57 SignonSecurityContext * signon_security_context_copy (
58                                         const SignonSecurityContext *src_ctx);
59 void signon_security_context_set_system_context (SignonSecurityContext *ctx,
60                                                  const gchar *system_context);
61 const gchar * signon_security_context_get_system_context (
62                                             const SignonSecurityContext *ctx);
63 void signon_security_context_set_application_context (
64                                             SignonSecurityContext *ctx,
65                                             const gchar *application_context);
66 const gchar * signon_security_context_get_application_context (
67                                             const SignonSecurityContext *ctx);
68 GVariant * signon_security_context_build_variant (
69                                             const SignonSecurityContext *ctx);
70 SignonSecurityContext * signon_security_context_deconstruct_variant (
71                                                             GVariant *variant);
72
73 GVariant * signon_security_context_list_build_variant (
74                                         const SignonSecurityContextList *list);
75 SignonSecurityContextList * signon_security_context_list_deconstruct_variant (
76                                                             GVariant *variant);
77
78 SignonSecurityContextList * signon_security_context_list_copy (
79                                     const SignonSecurityContextList *src_list);
80 void signon_security_context_list_free (SignonSecurityContextList *seclist);
81
82 G_END_DECLS
83
84 #endif  /* _SIGNON_SECURITY_CONTEXT_H_ */
85