summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Clapies <nclapies@entrouvert.com>2005-05-02 09:17:08 +0000
committerNicolas Clapies <nclapies@entrouvert.com>2005-05-02 09:17:08 +0000
commit892726542eca6c62687e0daf85ec4f0eaa56df0f (patch)
treed0e483205d4faf3aab1f928dfbce840536312633
parenta8ea72d5ff7642045aa7292634bcdf16af450e34 (diff)
wsse:Security class.
-rw-r--r--lasso/xml/wsse_security.c105
-rw-r--r--lasso/xml/wsse_security.h68
2 files changed, 173 insertions, 0 deletions
diff --git a/lasso/xml/wsse_security.c b/lasso/xml/wsse_security.c
new file mode 100644
index 00000000..a84ea48d
--- /dev/null
+++ b/lasso/xml/wsse_security.c
@@ -0,0 +1,105 @@
+/* $Id$
+ * Lasso - A free implementation of the Liberty Alliance specifications.
+ *
+ * Copyright (C) 2004, 2005 Entr'ouvert
+ * http://lasso.entrouvert.org
+ *
+ * Authors: See AUTHORS file in top-level directory.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <lasso/xml/wsse_security.h>
+
+/*
+ *
+ */
+
+/*****************************************************************************/
+/* private methods */
+/*****************************************************************************/
+
+static struct XmlSnippet schema_snippets[] = {
+ { "", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoWsseSecurity, any) },
+ { NULL, 0, 0}
+};
+
+/*****************************************************************************/
+/* instance and class init functions */
+/*****************************************************************************/
+
+static void
+instance_init(LassoWsseSecurity *node)
+{
+ node->any = NULL;
+}
+
+static void
+class_init(LassoWsseSecurityClass *klass)
+{
+ LassoNodeClass *nclass = LASSO_NODE_CLASS(klass);
+
+ nclass->node_data = g_new0(LassoNodeClassData, 1);
+ lasso_node_class_set_nodename(nclass, "Security");
+ lasso_node_class_set_ns(nclass, LASSO_WSSE_HREF, LASSO_WSSE_PREFIX);
+ lasso_node_class_add_snippets(nclass, schema_snippets);
+}
+
+GType
+lasso_wsse_security_get_type()
+{
+ static GType this_type = 0;
+
+ if (!this_type) {
+ static const GTypeInfo this_info = {
+ sizeof (LassoWsseSecurityClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) class_init,
+ NULL,
+ NULL,
+ sizeof(LassoWsseSecurity),
+ 0,
+ (GInstanceInitFunc) instance_init,
+ };
+
+ this_type = g_type_register_static(LASSO_TYPE_NODE,
+ "LassoWsseSecurity", &this_info, 0);
+ }
+ return this_type;
+}
+
+LassoWsseSecurity*
+lasso_wsse_security_new()
+{
+ LassoWsseSecurity *node;
+
+ node = g_object_new(LASSO_TYPE_WSSE_SECURITY, NULL);
+
+ return node;
+}
+
+LassoWsseSecurity*
+lasso_wsse_security_new_from_message(const gchar *message)
+{
+ LassoWsseSecurity *node;
+
+ g_return_val_if_fail(message != NULL, NULL);
+
+ node = g_object_new(LASSO_TYPE_WSSE_SECURITY, NULL);
+ lasso_node_init_from_message(LASSO_NODE(node), message);
+
+ return node;
+}
diff --git a/lasso/xml/wsse_security.h b/lasso/xml/wsse_security.h
new file mode 100644
index 00000000..ebf2f9ed
--- /dev/null
+++ b/lasso/xml/wsse_security.h
@@ -0,0 +1,68 @@
+/* $Id$
+ *
+ * Lasso - A free implementation of the Liberty Alliance specifications.
+ *
+ * Copyright (C) 2004, 2005 Entr'ouvert
+ * http://lasso.entrouvert.org
+ *
+ * Authors: See AUTHORS file in top-level directory.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LASSO_WSSE_SECURITY_H__
+#define __LASSO_WSSE_SECURITY_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <lasso/xml/xml.h>
+
+#define LASSO_TYPE_WSSE_SECURITY (lasso_wsse_security_get_type())
+#define LASSO_WSSE_SECURITY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+ LASSO_TYPE_WSSE_SECURITY, LassoWsseSecurity))
+#define LASSO_WSSE_SECURITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \
+ LASSO_TYPE_WSSE_SECURITY, LassoWsseSecurityClass))
+#define LASSO_IS_WSSE_SECURITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_WSSE_SECURITY))
+#define LASSO_IS_WSSE_SECURITY_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass),LASSO_TYPE_WSSE_SECURITY))
+#define LASSO_WSSE_SECURITY_GET_CLASS(o) \
+ (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_WSSE_SECURITY, LassoWsseSecurityClass))
+
+typedef struct _LassoWsseSecurity LassoWsseSecurity;
+typedef struct _LassoWsseSecurityClass LassoWsseSecurityClass;
+
+struct _LassoWsseSecurity {
+ LassoNode parent;
+
+ GList *any;
+};
+
+struct _LassoWsseSecurityClass {
+ LassoNodeClass parent;
+};
+
+LASSO_EXPORT GType lasso_wsse_security_get_type(void);
+
+LASSO_EXPORT LassoWsseSecurity* lasso_wsse_security_new(void);
+
+LASSO_EXPORT LassoWsseSecurity* lasso_wsse_security_new_from_message(const gchar *message);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __LASSO_WSSE_SECURITY_H__ */