1
/* $Id: wsse_reference.c,v 1.0 2005/10/14 15:17:55 fpeters Exp $
3
* Lasso - A free implementation of the Liberty Alliance specifications.
5
* Copyright (C) 2004-2007 Entr'ouvert
6
* http://lasso.entrouvert.org
8
* Authors: See AUTHORS file in top-level directory.
10
* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version.
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software
22
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
#include "wsse_reference.h"
28
* Schema fragment (oasis-200401-wss-wssecurity-secext-1.0.xsd):
30
* <xs:complexType name="ReferenceType">
32
* <xs:documentation>This type represents a reference to an external security
33
* token.</xs:documentation>
35
* <xs:attribute name="URI" type="xs:anyURI"/>
36
* <xs:attribute name="ValueType" type="xs:anyURI"/>
37
* <xs:anyAttribute namespace="##other" processContents="lax"/>
41
/*****************************************************************************/
43
/*****************************************************************************/
46
static struct XmlSnippet schema_snippets[] = {
47
{ "URI", SNIPPET_ATTRIBUTE,
48
G_STRUCT_OFFSET(LassoWsSec1Reference, URI) },
49
{ "ValueType", SNIPPET_ATTRIBUTE,
50
G_STRUCT_OFFSET(LassoWsSec1Reference, ValueType) },
51
{ "attributes", SNIPPET_ATTRIBUTE | SNIPPET_ANY,
52
G_STRUCT_OFFSET(LassoWsSec1Reference, attributes) },
56
static LassoNodeClass *parent_class = NULL;
59
/*****************************************************************************/
60
/* instance and class init functions */
61
/*****************************************************************************/
64
instance_init(LassoWsSec1Reference *node)
67
node->ValueType = NULL;
68
node->attributes = g_hash_table_new_full(
69
g_str_hash, g_str_equal, g_free, g_free);
73
class_init(LassoWsSec1ReferenceClass *klass)
75
LassoNodeClass *nclass = LASSO_NODE_CLASS(klass);
77
parent_class = g_type_class_peek_parent(klass);
78
nclass->node_data = g_new0(LassoNodeClassData, 1);
79
lasso_node_class_set_nodename(nclass, "Reference");
80
lasso_node_class_set_ns(nclass, LASSO_WSSE1_HREF, LASSO_WSSE1_PREFIX);
81
lasso_node_class_add_snippets(nclass, schema_snippets);
85
lasso_wsse_reference_get_type()
87
static GType this_type = 0;
90
static const GTypeInfo this_info = {
91
sizeof (LassoWsSec1ReferenceClass),
94
(GClassInitFunc) class_init,
97
sizeof(LassoWsSec1Reference),
99
(GInstanceInitFunc) instance_init,
102
this_type = g_type_register_static(LASSO_TYPE_NODE,
103
"LassoWsSec1Reference", &this_info, 0);
109
* lasso_wsse_reference_new:
111
* Creates a new #LassoWsSec1Reference object.
113
* Return value: a newly created #LassoWsSec1Reference object
115
LassoWsSec1Reference*
116
lasso_wsse_reference_new()
118
return g_object_new(LASSO_TYPE_WSSE_REFERENCE, NULL);