~vcs-imports/ifolder/dev

« back to all changes in this revision

Viewing changes to tools/gsoap/gsoap-linux-2.7/plugin/wsseapi.h

  • Committer: kalidasbala
  • Date: 2007-11-22 15:45:57 UTC
  • Revision ID: vcs-imports@canonical.com-20071122154557-rowdjwpay7knkj9l
Update of gsoap to latest version 2.7.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 
 
3
wsseapi.h
 
4
 
 
5
WS-Security plugin
 
6
 
 
7
gSOAP XML Web services tools
 
8
Copyright (C) 2000-2005, Robert van Engelen, Genivia Inc., All Rights Reserved.
 
9
This part of the software is released under one of the following licenses:
 
10
GPL, the gSOAP public license, or Genivia's license for commercial use.
 
11
--------------------------------------------------------------------------------
 
12
gSOAP public license.
 
13
 
 
14
The contents of this file are subject to the gSOAP Public License Version 1.3
 
15
(the "License"); you may not use this file except in compliance with the
 
16
License. You may obtain a copy of the License at
 
17
http://www.cs.fsu.edu/~engelen/soaplicense.html
 
18
Software distributed under the License is distributed on an "AS IS" basis,
 
19
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 
20
for the specific language governing rights and limitations under the License.
 
21
 
 
22
The Initial Developer of the Original Code is Robert A. van Engelen.
 
23
Copyright (C) 2000-2005, Robert van Engelen, Genivia Inc., All Rights Reserved.
 
24
--------------------------------------------------------------------------------
 
25
GPL license.
 
26
 
 
27
This program is free software; you can redistribute it and/or modify it under
 
28
the terms of the GNU General Public License as published by the Free Software
 
29
Foundation; either version 2 of the License, or (at your option) any later
 
30
version.
 
31
 
 
32
This program is distributed in the hope that it will be useful, but WITHOUT ANY
 
33
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 
34
PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
35
 
 
36
You should have received a copy of the GNU General Public License along with
 
37
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 
38
Place, Suite 330, Boston, MA 02111-1307 USA
 
39
 
 
40
Author contact information:
 
41
engelen@genivia.com / engelen@acm.org
 
42
--------------------------------------------------------------------------------
 
43
A commercial use license is available from Genivia, Inc., contact@genivia.com
 
44
--------------------------------------------------------------------------------
 
45
*/
 
46
 
 
47
#include "soapH.h"
 
48
#include "smdevp.h"
 
49
 
 
50
/** plugin identification for plugin registry */
 
51
#define SOAP_WSSE_ID "SOAP-WSSE-1.1"
 
52
 
 
53
/** plugin identification for plugin registry */
 
54
extern const char soap_wsse_id[];
 
55
 
 
56
/**
 
57
@struct soap_wsse_data
 
58
@brief wsseapi plugin data
 
59
 
 
60
The signature key (private) and verification key (public) are kept in the
 
61
plugin data, together with other info.
 
62
*/
 
63
struct soap_wsse_data
 
64
{ int sign_alg;                 /**< The digest or signature algorithm used */
 
65
  const void *sign_key;         /**< EVP_PKEY or key string for HMAC */
 
66
  int sign_keylen;              /**< HMAC key length */
 
67
  int vrfy_alg;                 /**< The signature verify algorithm used */
 
68
  const void *vrfy_key;         /**< EVP_PKEY or key string for HMAC verify */
 
69
  int vrfy_keylen;              /**< HMAC key length */
 
70
  struct soap_wsse_digest *digest;      /**< List of ID-hash pairs */
 
71
  int (*fprepareinit)(struct soap*);
 
72
  int (*fpreparesend)(struct soap*, const char*, size_t);
 
73
  int (*fpreparefinal)(struct soap*);
 
74
  int (*fdisconnect)(struct soap*);
 
75
  X509_STORE *store;
 
76
  const void *(*security_token_handler)(struct soap *soap, int alg, int *keylen);
 
77
};
 
78
 
 
79
/**
 
80
@struct soap_wsse_digest
 
81
@brief Digest dictionary: linked list of ID-hash pairs
 
82
 
 
83
The digest dictionary is populated by the soap_wsse_preparesend callback. The
 
84
callback intercepts XML elements with wsu:Id attributes and computes the digest
 
85
during the preprocessing of a message transmission. The 'level' field is used
 
86
to determine when the end of an element is reached by handling inner wsu:Id
 
87
attributed elements, so that the outer wsu:Id attributed element can be hashed.
 
88
*/
 
89
struct soap_wsse_digest
 
90
{ struct soap_wsse_digest *next;        /**< Next in list */
 
91
  unsigned int level;                   /**< XML parser depth level */
 
92
  struct soap_smd_data smd;             /**< smdevp engine context */
 
93
  unsigned char hash[SOAP_SMD_MAX_SIZE];/**< Digest hash value */
 
94
  char id[1];                           /**< String flows down the struct */
 
95
};
 
96
 
 
97
extern const char *wsse_PasswordTextURI;
 
98
extern const char *wsse_PasswordDigestURI;
 
99
extern const char *wsse_Base64BinaryURI;
 
100
extern const char *wsse_X509v3URI;
 
101
extern const char *wsse_X509v3SubjectKeyIdentifierURI;
 
102
 
 
103
extern const char *ds_sha1URI;
 
104
extern const char *ds_hmac_sha1URI;
 
105
extern const char *ds_dsa_sha1URI;
 
106
extern const char *ds_rsa_sha1URI;
 
107
 
 
108
extern const char *ds_URI;
 
109
extern const char *c14n_URI;
 
110
extern const char *wsu_URI;
 
111
 
 
112
struct _wsse__Security* soap_wsse_add_Security(struct soap *soap);
 
113
struct _wsse__Security* soap_wsse_add_Security_actor(struct soap *soap, const char *actor);
 
114
void soap_wsse_delete_Security(struct soap *soap);
 
115
struct _wsse__Security* soap_wsse_Security(struct soap *soap);
 
116
 
 
117
struct ds__SignatureType* soap_wsse_add_Signature(struct soap *soap);
 
118
void soap_wsse_delete_Signature(struct soap *soap);
 
119
struct ds__SignatureType* soap_wsse_Signature(struct soap *soap);
 
120
 
 
121
int soap_wsse_add_Timestamp(struct soap *soap, const char *id, time_t lifetime);
 
122
struct _wsu__Timestamp *soap_wsse_Timestamp(struct soap *soap);
 
123
int soap_wsse_verify_Timestamp(struct soap *soap);
 
124
 
 
125
int soap_wsse_add_UsernameTokenText(struct soap *soap, const char *id, const char *username, const char *password);
 
126
int soap_wsse_add_UsernameTokenDigest(struct soap *soap, const char *id, const char *username, const char *password);
 
127
struct _wsse__UsernameToken *soap_wsse_UsernameToken(struct soap *soap, const char *id);
 
128
const char* soap_wsse_get_Username(struct soap *soap);
 
129
int soap_wsse_verify_Password(struct soap *soap, const char *password);
 
130
 
 
131
int soap_wsse_add_BinarySecurityToken(struct soap *soap, const char *id, const char *valueType, const unsigned char *data, int size);
 
132
int soap_wsse_add_BinarySecurityTokenX509(struct soap *soap, const char *id, X509 *cert);
 
133
int soap_wsse_add_BinarySecurityTokenPEM(struct soap *soap, const char *id, const char *filename);
 
134
struct _wsse__BinarySecurityToken *soap_wsse_BinarySecurityToken(struct soap *soap, const char *id);
 
135
int soap_wsse_get_BinarySecurityToken(struct soap *soap, const char *id, char **valueType, unsigned char **data, int *size);
 
136
X509 *soap_wsse_get_BinarySecurityTokenX509(struct soap *soap, const char *id);
 
137
int soap_wsse_verify_X509(struct soap *soap, X509 *cert);
 
138
 
 
139
struct ds__SignedInfoType *soap_wsse_add_SignedInfo(struct soap *soap);
 
140
int soap_wsse_add_SignedInfo_Reference(struct soap *soap, const char *URI, const char *transform, const char *inclusiveNamespaces, const char *HA);
 
141
int soap_wsse_add_SignedInfo_SignatureMethod(struct soap *soap, const char *method, int canonical);
 
142
struct ds__SignedInfoType *soap_wsse_SignedInfo(struct soap *soap);
 
143
int soap_wsse_get_SignedInfo_SignatureMethod(struct soap *soap, int *alg);
 
144
 
 
145
int soap_wsse_add_SignatureValue(struct soap *soap, int alg, const void *key, int keylen);
 
146
int soap_wsse_verify_SignatureValue(struct soap *soap, int alg, const void *key, int keylen);
 
147
int soap_wsse_verify_SignedInfo(struct soap *soap);
 
148
int soap_wsse_verify_digest(struct soap *soap, int alg, int canonical, const char *id, unsigned char hash[SOAP_SMD_MAX_SIZE]);
 
149
 
 
150
struct ds__KeyInfoType *soap_wsse_add_KeyInfo(struct soap *soap);
 
151
struct ds__KeyInfoType *soap_wsse_KeyInfo(struct soap *soap);
 
152
 
 
153
int soap_wsse_add_KeyInfo_KeyName(struct soap *soap, const char *name);
 
154
const char *soap_wsse_get_KeyInfo_KeyName(struct soap *soap);
 
155
 
 
156
int soap_wsse_add_KeyInfo_SecurityTokenReferenceURI(struct soap *soap, const char *URI, const char *valueType);
 
157
int soap_wsse_add_KeyInfo_SecurityTokenReferenceX509(struct soap *soap, const char *URI);
 
158
const char *soap_wsse_get_KeyInfo_SecurityTokenReferenceURI(struct soap *soap);
 
159
const char *soap_wsse_get_KeyInfo_SecurityTokenReferenceValueType(struct soap *soap);
 
160
X509 *soap_wsse_get_KeyInfo_SecurityTokenReferenceX509(struct soap *soap);
 
161
 
 
162
int soap_wsse_add_KeyInfo_SecurityTokenReferenceKeyIdentifier(struct soap *soap, const char *id, const char *valueType, unsigned char *data, int size);
 
163
const char *soap_wsse_get_KeyInfo_SecurityTokenReferenceKeyIdentifierValueType(struct soap *soap);
 
164
const unsigned char *soap_wsse_get_KeyInfo_SecurityTokenReferenceKeyIdentifier(struct soap *soap, int *size);
 
165
 
 
166
int soap_wsse_add_KeyInfo_SecurityTokenReferenceEmbedded(struct soap *soap, const char *id, const char *valueType);
 
167
 
 
168
int soap_wsse_fault(struct soap *soap, enum wsse__FaultcodeEnum fault, const char *detail);
 
169
 
 
170
int soap_wsse(struct soap *soap, struct soap_plugin *p, void *arg);
 
171
 
 
172
int soap_wsse_sign(struct soap *soap, int alg, const void *key, int keylen);
 
173
int soap_wsse_sign_body(struct soap *soap, int alg, const void *key, int keylen);
 
174
int soap_wsse_verify_init(struct soap *soap);
 
175
int soap_wsse_verify_auto(struct soap *soap, int alg, const void *key, size_t keylen);
 
176
int soap_wsse_verify_done(struct soap *soap);
 
177
 
 
178
SOAP_FMAC1 void SOAP_FMAC2 soap_default_xsd__anyType(struct soap*, struct soap_dom_element *node);
 
179
SOAP_FMAC1 int SOAP_FMAC2 soap_out_xsd__anyType(struct soap *soap, const char *tag, int id, const struct soap_dom_element *node, const char *type);
 
180
SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_in_xsd__anyType(struct soap *soap, const char *tag, struct soap_dom_element *node, const char *type);