6 * Copyright (C) 2011 SIPE Project <http://sipe.sourceforge.net/>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 * Interface dependencies:
30 /* Forward declarations */
31 struct sipe_core_private
;
35 * Service XML callback
37 * @param sipe_private SIPE core private data
38 * @param uri service URI (NULL when request aborted)
39 * @param raw raw XML data (NULL when request failed)
40 * @param xml parsed XML data (NULL when request failed)
41 * @param callback_data callback data
43 typedef void (sipe_svc_callback
)(struct sipe_core_private
*sipe_private
,
46 struct _sipe_xml
*xml
,
47 gpointer callback_data
);
52 struct sipe_svc_random
{
54 guint length
; /* in bytes */
58 * Allocate a buffer with N random bits
60 * @param random pointer to random bytes buffer
61 * @param bits number of random bits (will be rounded up be dividable by 16)
63 void sipe_svc_fill_random(struct sipe_svc_random
*random
,
67 * Free a random bytes buffer
69 * @param random pointer to random bytes buffer
71 void sipe_svc_free_random(struct sipe_svc_random
*random
);
74 * Trigger fetch of Get & Publish certificate
76 * @param sipe_private SIPE core private data
77 * @param uri service URI
78 * @param wsse_security predefined authentication token
79 * @param certreq certificate request (Base64 encoded)
80 * @param callback callback function
81 * @param callback_data callback data
82 * @return @c TRUE if token fetch was triggered
84 gboolean
sipe_svc_get_and_publish_cert(struct sipe_core_private
*sipe_private
,
86 const gchar
*authuser
,
87 const gchar
*wsse_security
,
89 sipe_svc_callback
*callback
,
90 gpointer callback_data
);
93 * Trigger fetch of WebTicket security token
95 * @param sipe_private SIPE core private data
96 * @param uri service URI
97 * @param authuser user name for authentication
98 * @param wsse_security predefined authentication token
99 * @param service_uri request token for this service URI
100 * @param entropy random bytes buffer for entropy
101 * @param callback callback function
102 * @param callback_data callback data
103 * @return @c TRUE if token fetch was triggered
105 gboolean
sipe_svc_webticket(struct sipe_core_private
*sipe_private
,
107 const gchar
*authuser
,
108 const gchar
*wsse_security
,
109 const gchar
*service_uri
,
110 const struct sipe_svc_random
*entropy
,
111 sipe_svc_callback
*callback
,
112 gpointer callback_data
);
115 * Trigger fetch of WebTicket security token from login.microsoftonline.com
117 * @param sipe_private SIPE core private data
118 * @param authuser user name for authentication
119 * @param service_uri request token for this service URI
120 * @param callback callback function
121 * @param callback_data callback data
122 * @return @c TRUE if token fetch was triggered
124 gboolean
sipe_svc_webticket_lmc(struct sipe_core_private
*sipe_private
,
125 const gchar
*authuser
,
126 const gchar
*service_uri
,
127 sipe_svc_callback
*callback
,
128 gpointer callback_data
);
131 * Trigger fetch of service metadata
133 * @param sipe_private SIPE core private data
134 * @param uri service URI
135 * @param callback callback function
136 * @param callback_data callback data
137 * @return @c TRUE if metadata fetch was triggered
139 gboolean
sipe_svc_metadata(struct sipe_core_private
*sipe_private
,
141 sipe_svc_callback
*callback
,
142 gpointer callback_data
);
147 * @param sipe_private SIPE core private data
149 void sipe_svc_free(struct sipe_core_private
*sipe_private
);