1
/* $Id: samlp_request_abstract.c,v 1.14 2004/09/01 09:59:53 fpeters Exp $
3
* Lasso - A free implementation of the Liberty Alliance specifications.
5
* Copyright (C) 2004 Entr'ouvert
6
* http://lasso.entrouvert.org
8
* Authors: Nicolas Clapies <nclapies@entrouvert.com>
9
* Valery Febvre <vfebvre@easter-eggs.com>
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.
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.
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
28
#include <lasso/xml/samlp_request_abstract.h>
31
The schema fragment (oasis-sstc-saml-schema-protocol-1.0.xsd):
33
<complexType name="RequestAbstractType" abstract="true">
35
<element ref="samlp:RespondWith" minOccurs="0" maxOccurs="unbounded"/>
36
<element ref="ds:Signature" minOccurs="0"/>
38
<attribute name="RequestID" type="saml:IDType" use="required"/>
39
<attribute name="MajorVersion" type="integer" use="required"/>
40
<attribute name="MinorVersion" type="integer" use="required"/>
41
<attribute name="IssueInstant" type="dateTime" use="required"/>
44
<element name="RespondWith" type="QName"/>
46
From oasis-sstc-saml-schema-assertion-1.0.xsd:
47
<simpleType name="IDType">
48
<restriction base="string"/>
53
/*****************************************************************************/
55
/*****************************************************************************/
58
lasso_samlp_request_abstract_add_respondWith(LassoSamlpRequestAbstract *node,
59
const xmlChar *respondWith)
61
LassoNodeClass *class;
63
if (LASSO_IS_SAMLP_REQUEST_ABSTRACT(node) && respondWith != NULL) {
64
class = LASSO_NODE_GET_CLASS(node);
65
class->new_child(LASSO_NODE (node), "RespondWith", respondWith, TRUE);
70
lasso_samlp_request_abstract_set_issueInstant(LassoSamlpRequestAbstract *node,
71
const xmlChar *issueInstant)
73
LassoNodeClass *class;
75
if (LASSO_IS_SAMLP_REQUEST_ABSTRACT(node) && issueInstant != NULL) {
76
class = LASSO_NODE_GET_CLASS(node);
77
class->set_prop(LASSO_NODE (node), "IssueInstant", issueInstant);
82
lasso_samlp_request_abstract_set_majorVersion(LassoSamlpRequestAbstract *node,
83
const xmlChar *majorVersion)
85
LassoNodeClass *class;
87
if (LASSO_IS_SAMLP_REQUEST_ABSTRACT(node) && majorVersion != NULL) {
88
class = LASSO_NODE_GET_CLASS(node);
89
class->set_prop(LASSO_NODE (node), "MajorVersion", majorVersion);
94
lasso_samlp_request_abstract_set_minorVersion(LassoSamlpRequestAbstract *node,
95
const xmlChar *minorVersion)
97
LassoNodeClass *class;
99
if (LASSO_IS_SAMLP_REQUEST_ABSTRACT(node) && minorVersion != NULL) {
100
class = LASSO_NODE_GET_CLASS(node);
101
class->set_prop(LASSO_NODE (node), "MinorVersion", minorVersion);
106
* lasso_samlp_request_abstract_impl_set_requestID:
107
* @node: the pointer to <Samlp:RequestAbstract/> node
108
* @requestID: the RequestID attribute
110
* Sets the RequestID attribute (unique)
113
lasso_samlp_request_abstract_set_requestID(LassoSamlpRequestAbstract *node,
114
const xmlChar *requestID)
116
LassoNodeClass *class;
118
if (LASSO_IS_SAMLP_REQUEST_ABSTRACT(node) && requestID != NULL) {
119
class = LASSO_NODE_GET_CLASS(node);
120
class->set_prop(LASSO_NODE (node), "RequestID", requestID);
124
/* obsolete method */
126
lasso_samlp_request_abstract_set_signature(LassoSamlpRequestAbstract *node,
128
const xmlChar *private_key_file,
129
const xmlChar *certificate_file)
132
LassoNodeClass *class;
134
g_return_val_if_fail(LASSO_IS_SAMLP_REQUEST_ABSTRACT(node),
135
LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ);
137
class = LASSO_NODE_GET_CLASS(node);
139
ret = class->add_signature(LASSO_NODE (node), sign_method,
140
private_key_file, certificate_file);
146
lasso_samlp_request_abstract_set_signature_tmpl(LassoSamlpRequestAbstract *node,
147
lassoSignatureType sign_type,
148
lassoSignatureMethod sign_method,
149
xmlChar *reference_id)
151
LassoNodeClass *class;
153
g_return_val_if_fail(LASSO_IS_SAMLP_REQUEST_ABSTRACT(node),
154
LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ);
156
class = LASSO_NODE_GET_CLASS(node);
158
return class->add_signature_tmpl(LASSO_NODE (node), sign_type, sign_method, reference_id);
162
lasso_samlp_request_abstract_sign_signature_tmpl(LassoSamlpRequestAbstract *node,
163
const xmlChar *private_key_file,
164
const xmlChar *certificate_file)
166
LassoNodeClass *class;
168
g_return_val_if_fail(LASSO_IS_SAMLP_REQUEST_ABSTRACT(node),
169
LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ);
171
class = LASSO_NODE_GET_CLASS(node);
173
return(class->sign_signature_tmpl(LASSO_NODE (node), private_key_file,
177
/*****************************************************************************/
178
/* instance and class init functions */
179
/*****************************************************************************/
182
lasso_samlp_request_abstract_instance_init(LassoSamlpRequestAbstract *node)
184
LassoNodeClass *class = LASSO_NODE_GET_CLASS(LASSO_NODE(node));
186
class->set_ns(LASSO_NODE(node), lassoSamlProtocolHRef,
187
lassoSamlProtocolPrefix);
188
class->set_name(LASSO_NODE(node), "RequestAbstract");
192
lasso_samlp_request_abstract_class_init(LassoSamlpRequestAbstractClass *klass)
196
GType lasso_samlp_request_abstract_get_type() {
197
static GType this_type = 0;
200
static const GTypeInfo this_info = {
201
sizeof (LassoSamlpRequestAbstractClass),
204
(GClassInitFunc) lasso_samlp_request_abstract_class_init,
207
sizeof(LassoSamlpRequestAbstract),
209
(GInstanceInitFunc) lasso_samlp_request_abstract_instance_init,
212
this_type = g_type_register_static(LASSO_TYPE_NODE ,
213
"LassoSamlpRequestAbstract",
219
LassoNode* lasso_samlp_request_abstract_new() {
220
return LASSO_NODE(g_object_new(LASSO_TYPE_SAMLP_REQUEST_ABSTRACT,