summaryrefslogtreecommitdiff
path: root/library/gsecret-private.h
blob: 1a74f35cd7bcff910e08d6485ce90a746f570d59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/* GSecret - GLib wrapper for Secret Service
 *
 * Copyright 2011 Collabora Ltd.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation; either version 2 of the licence or (at
 * your option) any later version.
 *
 * See the included COPYING file for more information.

 */
#ifndef __GSECRET_PRIVATE_H__
#define __GSECRET_PRIVATE_H__

#include <gio/gio.h>

#include "gsecret-service.h"
#include "gsecret-value.h"

G_BEGIN_DECLS

typedef struct {
	GAsyncResult *result;
	GMainContext *context;
	GMainLoop *loop;
} GSecretSync;

typedef struct _GSecretSession GSecretSession;

#define             GSECRET_SERVICE_PATH              "/org/freedesktop/secrets"

#define             GSECRET_SERVICE_BUS_NAME          "org.freedesktop.Secret.Service"

#define             GSECRET_ITEM_INTERFACE            "org.freedesktop.Secret.Item"
#define             GSECRET_COLLECTION_INTERFACE      "org.freedesktop.Secret.Collection"
#define             GSECRET_PROMPT_INTERFACE          "org.freedesktop.Secret.Prompt"
#define             GSECRET_SERVICE_INTERFACE         "org.freedesktop.Secret.Service"

#define             GSECRET_PROMPT_SIGNAL_COMPLETED   "Completed"

#define             GSECRET_PROPERTIES_INTERFACE      "org.freedesktop.DBus.Properties"

GSecretSync *       _gsecret_sync_new                          (void);

void                _gsecret_sync_free                         (gpointer data);

void                _gsecret_sync_on_result                    (GObject *source,
                                                                GAsyncResult *result,
                                                                gpointer user_data);

GSecretPrompt *     _gsecret_prompt_instance                   (GDBusConnection *connection,
                                                                const gchar *object_path);

gchar *             _gsecret_util_parent_path         (const gchar *path);

gboolean            _gsecret_util_empty_path                   (const gchar *path);

GType               _gsecret_list_get_type                     (void) G_GNUC_CONST;

GVariant *          _gsecret_util_variant_for_attributes       (GHashTable *attributes);

GHashTable *        _gsecret_util_attributes_for_variant       (GVariant *variant);

GHashTable *        _gsecret_util_attributes_for_varargs       (const GSecretSchema *schema,
                                                                va_list va);

void                _gsecret_util_get_properties               (GDBusProxy *proxy,
                                                                gpointer result_tag,
                                                                GCancellable *cancellable,
                                                                GAsyncReadyCallback callback,
                                                                gpointer user_data);

gboolean            _gsecret_util_get_properties_finish        (GDBusProxy *proxy,
                                                                gpointer result_tag,
                                                                GAsyncResult *result,
                                                                GError **error);

void                _gsecret_util_set_property                 (GDBusProxy *proxy,
                                                                const gchar *property,
                                                                GVariant *value,
                                                                gpointer result_tag,
                                                                GCancellable *cancellable,
                                                                GAsyncReadyCallback callback,
                                                                gpointer user_data);

gboolean            _gsecret_util_set_property_finish          (GDBusProxy *proxy,
                                                                gpointer result_tag,
                                                                GAsyncResult *result,
                                                                GError **error);

gboolean            _gsecret_util_set_property_sync            (GDBusProxy *proxy,
                                                                const gchar *property,
                                                                GVariant *value,
                                                                GCancellable *cancellable,
                                                                GError **error);

gboolean            _gsecret_util_have_cached_properties       (GDBusProxy *proxy);

void                _gsecret_service_set_default_bus_name      (const gchar *bus_name);

#if 0
GSecretService *    _gsecret_service_bare_instance    (GDBusConnection *connection,
                                                       const gchar *bus_name);

void                _gsecret_service_bare_connect              (const gchar *bus_name,
                                                                gboolean ensure_session,
                                                                GCancellable *cancellable,
                                                                GAsyncReadyCallback callback,
                                                                gpointer user_data);

GSecretService *    _gsecret_service_bare_connect_finish       (GAsyncResult *result,
                                                                GError **error);
#endif

GSecretSession *    _gsecret_service_get_session               (GSecretService *self);

void                _gsecret_service_take_session              (GSecretService *self,
                                                                GSecretSession *session);

GSecretItem *       _gsecret_service_find_item_instance        (GSecretService *self,
                                                                const gchar *item_path);

GSecretItem *       _gsecret_collection_find_item_instance     (GSecretCollection *self,
                                                                const gchar *item_path);

gchar *             _gsecret_value_unref_to_password           (GSecretValue *value);

void                _gsecret_session_free                      (gpointer data);

const gchar *       _gsecret_session_get_algorithms            (GSecretSession *session);

const gchar *       _gsecret_session_get_path                  (GSecretSession *session);

void                _gsecret_session_open                      (GSecretService *service,
                                                                GCancellable *cancellable,
                                                                GAsyncReadyCallback callback,
                                                                gpointer user_data);

gboolean            _gsecret_session_open_finish               (GAsyncResult *result,
                                                                GError **error);

GVariant *          _gsecret_session_encode_secret             (GSecretSession *session,
                                                                GSecretValue *value);

GSecretValue *      _gsecret_session_decode_secret             (GSecretSession *session,
                                                                GVariant *encoded);

G_END_DECLS

#endif /* __G_SERVICE_H___ */