docs: update documentation of SignonSecurityContext
[platform/upstream/libgsignon-glib.git] / libgsignon-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 libgsignon-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 #include <glib-object.h>
30
31 G_BEGIN_DECLS
32
33 typedef struct _SignonSecurityContext SignonSecurityContext;
34
35 /**
36  * SignonSecurityContext:
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  * Security context descriptor used for access control checks. 
42  */
43 struct _SignonSecurityContext
44 {
45     gchar *sys_ctx;
46     gchar *app_ctx;
47 };
48
49 /**
50  * SignonSecurityContextList:
51  *
52  * GList of #SignonSecurityContext items.
53  */
54 typedef GList SignonSecurityContextList;
55
56 GType signon_security_context_get_type (void) G_GNUC_CONST;
57
58 SignonSecurityContext * signon_security_context_new ();
59 SignonSecurityContext * signon_security_context_new_from_values (
60                                             const gchar *system_context,
61                                             const gchar *application_context);
62 void signon_security_context_free (SignonSecurityContext *ctx);
63 SignonSecurityContext * signon_security_context_copy (
64                                         const SignonSecurityContext *src_ctx);
65 void signon_security_context_set_system_context (SignonSecurityContext *ctx,
66                                                  const gchar *system_context);
67 const gchar * signon_security_context_get_system_context (
68                                             const SignonSecurityContext *ctx);
69 void signon_security_context_set_application_context (
70                                             SignonSecurityContext *ctx,
71                                             const gchar *application_context);
72 const gchar * signon_security_context_get_application_context (
73                                             const SignonSecurityContext *ctx);
74 GVariant * signon_security_context_build_variant (
75                                             const SignonSecurityContext *ctx);
76 SignonSecurityContext * signon_security_context_deconstruct_variant (
77                                                             GVariant *variant);
78
79 GVariant * signon_security_context_list_build_variant (
80                                         const SignonSecurityContextList *list);
81 SignonSecurityContextList * signon_security_context_list_deconstruct_variant (
82                                                             GVariant *variant);
83
84 SignonSecurityContextList * signon_security_context_list_copy (
85                                     const SignonSecurityContextList *src_list);
86 void signon_security_context_list_free (SignonSecurityContextList *seclist);
87
88 G_END_DECLS
89
90 #endif  /* _SIGNON_SECURITY_CONTEXT_H_ */
91