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

« back to all changes in this revision

Viewing changes to lasso/xml/lib_request_authn_context.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: lib_request_authn_context.c,v 1.4 2004/08/13 15:16:13 fpeters Exp $
 
2
 *
 
3
 * Lasso - A free implementation of the Liberty 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/lib_request_authn_context.h>
 
27
 
 
28
/*
 
29
Information describing which authentication context the requester desires the
 
30
identity provider to use in authenticating the Principal.
 
31
 
 
32
Schema fragment (liberty-idff-protocols-schema-v1.2.xsd):
 
33
 
 
34
<xs:element name="RequestAuthnContext">
 
35
  <xs:complexType>
 
36
    <xs:sequence>
 
37
      <xs:choice>
 
38
        <xs:element name="AuthnContextClassRef" type="xs:anyURI" maxOccurs="unbounded"/>
 
39
        <xs:element name="AuthnContextStatementRef" type="xs:anyURI" maxOccurs="unbounded"/>
 
40
      </xs:choice>
 
41
      <xs:element name="AuthnContextComparison" type="AuthnContextComparisonType" minOccurs="0"/>
 
42
    </xs:sequence>
 
43
  </xs:complexType>
 
44
</xs:element>
 
45
*/
 
46
 
 
47
/*****************************************************************************/
 
48
/* public methods                                                            */
 
49
/*****************************************************************************/
 
50
 
 
51
void
 
52
lasso_lib_request_authn_context_add_authnContextClassRef(LassoLibRequestAuthnContext *node,
 
53
                                                         const xmlChar *authnContextClassRef)
 
54
{
 
55
  LassoNodeClass *class;
 
56
  g_assert(LASSO_IS_LIB_REQUEST_AUTHN_CONTEXT(node));
 
57
  g_assert(authnContextClassRef != NULL);
 
58
 
 
59
  class = LASSO_NODE_GET_CLASS(node);
 
60
  class->new_child(LASSO_NODE (node), "AuthnContextClassRef",
 
61
                   authnContextClassRef, TRUE);
 
62
}
 
63
 
 
64
void
 
65
lasso_lib_request_authn_context_add_authnContextStatementRef(LassoLibRequestAuthnContext *node,
 
66
                                                             const xmlChar *authnContextStatementRef)
 
67
{
 
68
  LassoNodeClass *class;
 
69
  g_assert(LASSO_IS_LIB_REQUEST_AUTHN_CONTEXT(node));
 
70
  g_assert(authnContextStatementRef != NULL);
 
71
 
 
72
  class = LASSO_NODE_GET_CLASS(node);
 
73
  class->new_child(LASSO_NODE (node), "AuthnContextStatementRef",
 
74
                   authnContextStatementRef, TRUE);
 
75
}
 
76
 
 
77
void
 
78
lasso_lib_request_authn_context_set_authnContextComparison(LassoLibRequestAuthnContext *node,
 
79
                                                           const xmlChar *authnContextComparison)
 
80
{
 
81
  LassoNodeClass *class;
 
82
  g_assert(LASSO_IS_LIB_REQUEST_AUTHN_CONTEXT(node));
 
83
  g_assert(authnContextComparison != NULL);
 
84
 
 
85
  class = LASSO_NODE_GET_CLASS(node);
 
86
  class->new_child(LASSO_NODE (node), "AuthnContextComparison",
 
87
                   authnContextComparison, FALSE);
 
88
}
 
89
 
 
90
/*****************************************************************************/
 
91
/* instance and class init functions                                         */
 
92
/*****************************************************************************/
 
93
 
 
94
static void
 
95
lasso_lib_request_authn_context_instance_init(LassoLibRequestAuthnContext *node)
 
96
{
 
97
  LassoNodeClass *class = LASSO_NODE_GET_CLASS(LASSO_NODE(node));
 
98
 
 
99
  class->set_ns(LASSO_NODE(node), lassoLibHRef, lassoLibPrefix);
 
100
  class->set_name(LASSO_NODE(node), "RequestAuthnContext");
 
101
}
 
102
 
 
103
static void
 
104
lasso_lib_request_authn_context_class_init(LassoLibRequestAuthnContextClass *klass)
 
105
{
 
106
}
 
107
 
 
108
GType lasso_lib_request_authn_context_get_type() {
 
109
  static GType this_type = 0;
 
110
 
 
111
  if (!this_type) {
 
112
    static const GTypeInfo this_info = {
 
113
      sizeof (LassoLibRequestAuthnContextClass),
 
114
      NULL,
 
115
      NULL,
 
116
      (GClassInitFunc) lasso_lib_request_authn_context_class_init,
 
117
      NULL,
 
118
      NULL,
 
119
      sizeof(LassoLibRequestAuthnContext),
 
120
      0,
 
121
      (GInstanceInitFunc) lasso_lib_request_authn_context_instance_init,
 
122
    };
 
123
    
 
124
    this_type = g_type_register_static(LASSO_TYPE_NODE,
 
125
                                       "LassoLibRequestAuthnContext",
 
126
                                       &this_info, 0);
 
127
  }
 
128
  return this_type;
 
129
}
 
130
 
 
131
LassoNode* lasso_lib_request_authn_context_new() {
 
132
  return LASSO_NODE(g_object_new(LASSO_TYPE_LIB_REQUEST_AUTHN_CONTEXT, NULL));
 
133
}