more work on SAML ification
[mech_eap.git] / util_saml.h
1 /*
2  * Copyright (c) 2010, JANET(UK)
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  *
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * 3. Neither the name of JANET(UK) nor the names of its contributors
17  *    may be used to endorse or promote products derived from this software
18  *    without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30  * SUCH DAMAGE.
31  */
32
33 #ifndef _UTIL_SAML_H_
34 #define _UTIL_SAML_H_ 1
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 struct eap_gss_saml_attr_ctx;
41
42 OM_uint32
43 samlDuplicateAttrContext(OM_uint32 *minor,
44                          const struct eap_gss_saml_attr_ctx *in,
45                          struct eap_gss_saml_attr_ctx **out);
46
47 OM_uint32
48 samlCreateAttrContext(OM_uint32 *minor,
49                       gss_cred_id_t acceptorCred,
50                       gss_name_t initiatorName,
51                       gss_buffer_t buffer,
52                       struct eap_gss_saml_attr_ctx **pCtx);
53
54 OM_uint32
55 samlReleaseAttrContext(OM_uint32 *minor,
56                        struct eap_gss_saml_attr_ctx **ctx);
57
58 OM_uint32
59 samlGetAttributeTypes(OM_uint32 *minor,
60                       const struct eap_gss_saml_attr_ctx *ctx,
61                       void *data,
62                       OM_uint32 (*addAttribute)(OM_uint32 *, void *, gss_buffer_t));
63
64 OM_uint32
65 samlGetAttribute(OM_uint32 *minor,
66                  struct eap_gss_saml_attr_ctx *ctx,
67                  gss_buffer_t attr,
68                  int *authenticated,
69                  int *complete,
70                  gss_buffer_t value,
71                  gss_buffer_t display_value,
72                  int *more);
73
74 OM_uint32
75 samlSetAttribute(OM_uint32 *minor,
76                  struct eap_gss_saml_attr_ctx *ctx,
77                  int complete,
78                  gss_buffer_t attr,
79                  gss_buffer_t value);
80
81 OM_uint32
82 samlDeleteAttribute(OM_uint32 *minor,
83                     struct eap_gss_saml_attr_ctx *ctx,
84                     gss_buffer_t attr);
85
86 OM_uint32
87 samlExportAttrContext(OM_uint32 *minor,
88                       struct eap_gss_saml_attr_ctx *ctx,
89                       gss_buffer_t buffer);
90
91 OM_uint32
92 samlImportAttrContext(OM_uint32 *minor,
93                       gss_buffer_t buffer,
94                       struct eap_gss_saml_attr_ctx **pCtx);
95
96 OM_uint32
97 samlGetAssertion(OM_uint32 *minor,
98                  struct eap_gss_saml_attr_ctx *ctx,
99                  gss_buffer_t assertion);
100  
101 #ifdef __cplusplus
102 }
103 #endif
104
105 #endif /* _UTIL_SAML_H_ */