~ubuntu-branches/ubuntu/utopic/lasso/utopic-proposed

« back to all changes in this revision

Viewing changes to lasso/xml/saml_subject_confirmation.c

  • Committer: Bazaar Package Importer
  • Author(s): Frederic Peters
  • Date: 2004-09-13 09:26:34 UTC
  • Revision ID: james.westby@ubuntu.com-20040913092634-01vdfl8j9cp94exa
Tags: upstream-0.4.1
ImportĀ upstreamĀ versionĀ 0.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: saml_subject_confirmation.c,v 1.4 2004/08/13 15:16:13 fpeters Exp $
 
2
 *
 
3
 * Lasso - A free implementation of the Samlerty Alliance specifications.
 
4
 *
 
5
 * Copyright (C) 2004 Entr'ouvert
 
6
 * http://lasso.entrouvert.org
 
7
 * 
 
8
 * Authors: Nicolas Clapies <nclapies@entrouvert.com>
 
9
 *          Valery Febvre <vfebvre@easter-eggs.com>
 
10
 *
 
11
 * This program is free software; you can redistribute it and/or modify
 
12
 * it under the terms of the GNU General Public License as published by
 
13
 * the Free Software Foundation; either version 2 of the License, or
 
14
 * (at your option) any later version.
 
15
 * 
 
16
 * This program is distributed in the hope that it will be useful,
 
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
19
 * GNU General Public License for more details.
 
20
 * 
 
21
 * You should have received a copy of the GNU General Public License
 
22
 * along with this program; if not, write to the Free Software
 
23
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
24
 */
 
25
 
 
26
#include <lasso/xml/saml_subject_confirmation.h>
 
27
 
 
28
/*
 
29
The schema fragment (oasis-sstc-saml-schema-assertion-1.0.xsd):
 
30
 
 
31
<element name="SubjectConfirmation" type="saml:SubjectConfirmationType"/>
 
32
<complexType name="SubjectConfirmationType">
 
33
  <sequence>
 
34
    <element ref="saml:ConfirmationMethod" maxOccurs="unbounded"/>
 
35
    <element ref="saml:SubjectConfirmationData" minOccurs="0"/>
 
36
    <element ref="ds:KeyInfo" minOccurs="0"/>
 
37
  </sequence>
 
38
</complexType>
 
39
 
 
40
<element name="SubjectConfirmationData" type="anyType"/>
 
41
<element name="ConfirmationMethod" type="anyURI"/>
 
42
*/
 
43
 
 
44
/*****************************************************************************/
 
45
/* public methods                                                            */
 
46
/*****************************************************************************/
 
47
 
 
48
void
 
49
lasso_saml_subject_confirmation_add_confirmationMethod(LassoSamlSubjectConfirmation *node,
 
50
                                                       const xmlChar *confirmationMethod)
 
51
{
 
52
  LassoNodeClass *class;
 
53
  g_assert(LASSO_IS_SAML_SUBJECT_CONFIRMATION(node));
 
54
  g_assert(confirmationMethod != NULL);
 
55
 
 
56
  class = LASSO_NODE_GET_CLASS(node);
 
57
  class->new_child(LASSO_NODE (node),
 
58
                   "ConfirmationMethod", confirmationMethod, TRUE);
 
59
}
 
60
 
 
61
void
 
62
lasso_saml_subject_confirmation_set_subjectConfirmationMethod(LassoSamlSubjectConfirmation *node,
 
63
                                                              const xmlChar *subjectConfirmationMethod)
 
64
{
 
65
  LassoNodeClass *class;
 
66
  g_assert(LASSO_IS_SAML_SUBJECT_CONFIRMATION(node));
 
67
  g_assert(subjectConfirmationMethod != NULL);
 
68
 
 
69
  class = LASSO_NODE_GET_CLASS(node);
 
70
  class->new_child(LASSO_NODE (node),
 
71
                   "SubjectConfirmationMethod", subjectConfirmationMethod,
 
72
                   FALSE);
 
73
}
 
74
 
 
75
/*****************************************************************************/
 
76
/* instance and class init functions                                         */
 
77
/*****************************************************************************/
 
78
 
 
79
static void
 
80
lasso_saml_subject_confirmation_instance_init(LassoSamlSubjectConfirmation *node)
 
81
{
 
82
  LassoNodeClass *class = LASSO_NODE_GET_CLASS(LASSO_NODE(node));
 
83
 
 
84
  class->set_ns(LASSO_NODE(node), lassoSamlAssertionHRef,
 
85
                lassoSamlAssertionPrefix);
 
86
  class->set_name(LASSO_NODE(node), "SubjectConfirmation");
 
87
}
 
88
 
 
89
static void
 
90
lasso_saml_subject_confirmation_class_init(LassoSamlSubjectConfirmationClass *klass)
 
91
{
 
92
}
 
93
 
 
94
GType lasso_saml_subject_confirmation_get_type() {
 
95
  static GType this_type = 0;
 
96
 
 
97
  if (!this_type) {
 
98
    static const GTypeInfo this_info = {
 
99
      sizeof (LassoSamlSubjectConfirmationClass),
 
100
      NULL,
 
101
      NULL,
 
102
      (GClassInitFunc) lasso_saml_subject_confirmation_class_init,
 
103
      NULL,
 
104
      NULL,
 
105
      sizeof(LassoSamlSubjectConfirmation),
 
106
      0,
 
107
      (GInstanceInitFunc) lasso_saml_subject_confirmation_instance_init,
 
108
    };
 
109
    
 
110
    this_type = g_type_register_static(LASSO_TYPE_NODE,
 
111
                                       "LassoSamlSubjectConfirmation",
 
112
                                       &this_info, 0);
 
113
  }
 
114
  return this_type;
 
115
}
 
116
 
 
117
/**
 
118
 * lasso_saml_subject_confirmation_new:
 
119
 * 
 
120
 * Creates a new <saml:SubjectConfirmation> node object.
 
121
 * 
 
122
 * Return value: the new @LassoSamlSubjectConfirmation
 
123
 **/
 
124
LassoNode* lasso_saml_subject_confirmation_new()
 
125
{
 
126
  return LASSO_NODE(g_object_new(LASSO_TYPE_SAML_SUBJECT_CONFIRMATION, NULL));
 
127
}