~ubuntu-branches/ubuntu/intrepid/lasso/intrepid-security

« back to all changes in this revision

Viewing changes to lasso/xml/saml-2.0/saml2_subject_confirmation.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2006-07-11 10:01:32 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060711100132-e50ymjc54bsizza6
Tags: 0.6.5-2ubuntu1
* Synchronize with Debian unstable.
* Convert to updated Python policy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: saml2_subject_confirmation.c,v 1.2 2005/11/21 18:51:52 fpeters Exp $ 
 
2
 *
 
3
 * Lasso - A free implementation of the Liberty Alliance specifications.
 
4
 *
 
5
 * Copyright (C) 2004, 2005 Entr'ouvert
 
6
 * http://lasso.entrouvert.org
 
7
 * 
 
8
 * Authors: See AUTHORS file in top-level directory.
 
9
 *
 
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.
 
14
 * 
 
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.
 
19
 * 
 
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
 
23
 */
 
24
 
 
25
#include "saml2_subject_confirmation.h"
 
26
 
 
27
/*
 
28
 * Schema fragment (saml-schema-assertion-2.0.xsd):
 
29
 *
 
30
 * <complexType name="SubjectConfirmationType">
 
31
 *   <sequence>
 
32
 *     <choice minOccurs="0">
 
33
 *       <element ref="saml:BaseID"/>
 
34
 *       <element ref="saml:NameID"/>
 
35
 *       <element ref="saml:EncryptedID"/>
 
36
 *     </choice>
 
37
 *     <element ref="saml:SubjectConfirmationData" minOccurs="0"/>
 
38
 *   </sequence>
 
39
 *   <attribute name="Method" type="anyURI" use="required"/>
 
40
 * </complexType>
 
41
 */
 
42
 
 
43
/*****************************************************************************/
 
44
/* private methods                                                           */
 
45
/*****************************************************************************/
 
46
 
 
47
 
 
48
static struct XmlSnippet schema_snippets[] = {
 
49
        { "BaseID", SNIPPET_NODE,
 
50
                G_STRUCT_OFFSET(LassoSaml2SubjectConfirmation, BaseID) },
 
51
        { "NameID", SNIPPET_NODE,
 
52
                G_STRUCT_OFFSET(LassoSaml2SubjectConfirmation, NameID) },
 
53
        { "EncryptedID", SNIPPET_NODE,
 
54
                G_STRUCT_OFFSET(LassoSaml2SubjectConfirmation, EncryptedID),
 
55
                "LassoSaml2EncryptedElement" },
 
56
        { "SubjectConfirmationData", SNIPPET_NODE,
 
57
                G_STRUCT_OFFSET(LassoSaml2SubjectConfirmation, SubjectConfirmationData) },
 
58
        { "Method", SNIPPET_ATTRIBUTE,
 
59
                G_STRUCT_OFFSET(LassoSaml2SubjectConfirmation, Method) },
 
60
        {NULL, 0, 0}
 
61
};
 
62
 
 
63
static LassoNodeClass *parent_class = NULL;
 
64
 
 
65
 
 
66
/*****************************************************************************/
 
67
/* instance and class init functions                                         */
 
68
/*****************************************************************************/
 
69
 
 
70
static void
 
71
instance_init(LassoSaml2SubjectConfirmation *node)
 
72
{
 
73
        node->BaseID = NULL;
 
74
        node->NameID = NULL;
 
75
        node->EncryptedID = NULL;
 
76
        node->SubjectConfirmationData = NULL;
 
77
        node->Method = NULL;
 
78
}
 
79
 
 
80
static void
 
81
class_init(LassoSaml2SubjectConfirmationClass *klass)
 
82
{
 
83
        LassoNodeClass *nclass = LASSO_NODE_CLASS(klass);
 
84
 
 
85
        parent_class = g_type_class_peek_parent(klass);
 
86
        nclass->node_data = g_new0(LassoNodeClassData, 1);
 
87
        lasso_node_class_set_nodename(nclass, "SubjectConfirmation"); 
 
88
        lasso_node_class_set_ns(nclass, LASSO_SAML2_ASSERTION_HREF, LASSO_SAML2_ASSERTION_PREFIX);
 
89
        lasso_node_class_add_snippets(nclass, schema_snippets);
 
90
}
 
91
 
 
92
GType
 
93
lasso_saml2_subject_confirmation_get_type()
 
94
{
 
95
        static GType this_type = 0;
 
96
 
 
97
        if (!this_type) {
 
98
                static const GTypeInfo this_info = {
 
99
                        sizeof (LassoSaml2SubjectConfirmationClass),
 
100
                        NULL,
 
101
                        NULL,
 
102
                        (GClassInitFunc) class_init,
 
103
                        NULL,
 
104
                        NULL,
 
105
                        sizeof(LassoSaml2SubjectConfirmation),
 
106
                        0,
 
107
                        (GInstanceInitFunc) instance_init,
 
108
                };
 
109
 
 
110
                this_type = g_type_register_static(LASSO_TYPE_NODE,
 
111
                                "LassoSaml2SubjectConfirmation", &this_info, 0);
 
112
        }
 
113
        return this_type;
 
114
}
 
115
 
 
116
/**
 
117
 * lasso_saml2_subject_confirmation_new:
 
118
 *
 
119
 * Creates a new #LassoSaml2SubjectConfirmation object.
 
120
 *
 
121
 * Return value: a newly created #LassoSaml2SubjectConfirmation object
 
122
 **/
 
123
LassoNode*
 
124
lasso_saml2_subject_confirmation_new()
 
125
{
 
126
        return g_object_new(LASSO_TYPE_SAML2_SUBJECT_CONFIRMATION, NULL);
 
127
}