# trust_rst.h

    00001 /*
    00002  * Licensed to the Apache Software Foundation (ASF) under one or more
    00003  * contributor license agreements.  See the NOTICE file distributed with
    00004  * this work for additional information regarding copyright ownership.
    00005  * The ASF licenses this file to You under the Apache License, Version 2.0
    00006  * (the "License"); you may not use this file except in compliance with
    00007  * the License.  You may obtain a copy of the License at
    00008  *
    00009  *      http://www.apache.org/licenses/LICENSE-2.0
    00010  *
    00011  * Unless required by applicable law or agreed to in writing, software
    00012  * distributed under the License is distributed on an "AS IS" BASIS,
    00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00014  * See the License for the specific language governing permissions and
    00015  * limitations under the License.
    00016  */
    00017
    00018 #ifndef TRUST_RST_H
    00019 #define TRUST_RST_H
    00020
    00021 #include <stdio.h>
    00022 #include <stdlib.h>
    00023 #include <axutil_utils.h>
    00024 #include <axutil_base64.h>
    00025 #include <axiom_soap.h>
    00026 #include <axiom.h>
    00027 #include <trust_constants.h>
    00028 #include <trust_entropy.h>
    00029 #include <trust_claims.h>
    00030 #include <trust_life_time.h>
    00031 #include <rp_issued_token.h>
    00032
    00033 #ifdef __cplusplus
    00034 extern "C"
    00035 {
    00036 #endif
    00037
    00038    typedef struct trust_rst trust_rst_t;
    00039
    00040    /* Create RST Context*/
    00041    AXIS2_EXTERN trust_rst_t * AXIS2_CALL
    00042    trust_rst_create(
    00043            const axutil_env_t *env);
    00044
    00045     /* Populate RST Context from axiom_node*/
    00046     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00047     trust_rst_populate_rst(
    00048         trust_rst_t *rst,
    00049         const axutil_env_t *env,
    00050         axiom_node_t *rst_node);
    00051
    00052     /*Build RST message from the created RST Context */
    00053     AXIS2_EXTERN axiom_node_t * AXIS2_CALL
    00054     trust_rst_build_rst(
    00055         trust_rst_t *rst,
    00056         const axutil_env_t *env,
    00057         axiom_node_t *parent);
    00058
    00059         /*Automated RST building with RelyingParty's policy*/
    00060         AXIS2_EXTERN axiom_node_t * AXIS2_CALL
    00061         trust_rst_build_rst_with_issued_token_assertion(
    00062                 trust_rst_t *rst,
    00063                 const axutil_env_t *env,
    00064                 rp_issued_token_t *issued_token);
    00065
    00066
    00067     /* Getters & Setters */
    00068
    00069     AXIS2_EXTERN axis2_char_t * AXIS2_CALL
    00070     trust_rst_get_attr_context(
    00071         trust_rst_t *rst,
    00072         const axutil_env_t *env);
    00073
    00074     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00075     trust_rst_set_attr_context(
    00076         trust_rst_t *rst,
    00077         const axutil_env_t *env,
    00078         axis2_char_t *attr_context);
    00079
    00080
    00081     AXIS2_EXTERN axis2_char_t * AXIS2_CALL
    00082     trust_rst_get_token_type(
    00083         trust_rst_t *rst,
    00084         const axutil_env_t *env);
    00085
    00086     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00087     trust_rst_set_token_type(
    00088         trust_rst_t *rst,
    00089         const axutil_env_t *env,
    00090         axis2_char_t *token_type);
    00091
    00092
    00093     AXIS2_EXTERN axis2_char_t * AXIS2_CALL
    00094     trust_rst_get_request_type(
    00095         trust_rst_t *rst,
    00096         const axutil_env_t *env);
    00097
    00098     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00099     trust_rst_set_request_type(
    00100         trust_rst_t *rst,
    00101         const axutil_env_t *env,
    00102         axis2_char_t *request_type);
    00103
    00104         AXIS2_EXTERN axis2_char_t * AXIS2_CALL
    00105         trust_rst_get_wsa_action(
    00106                         trust_rst_t *rst,
    00107                         const axutil_env_t *env);
    00108
    00109         AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00110         trust_rst_set_wsa_action(
    00111                         trust_rst_t *rst,
    00112                         const axutil_env_t *env,
    00113                         axis2_char_t *wsa_action);
    00114
    00115     AXIS2_EXTERN axis2_char_t * AXIS2_CALL
    00116     trust_rst_get_applies_to_addr(
    00117         trust_rst_t *rst,
    00118         const axutil_env_t *env);
    00119
    00120     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00121     trust_rst_set_appliesto(
    00122         trust_rst_t *rst,
    00123         const axutil_env_t *env,
    00124         axis2_char_t *applies_to_addr);
    00125
    00126
    00127     AXIS2_EXTERN trust_claims_t * AXIS2_CALL
    00128     trust_rst_get_claims(
    00129         trust_rst_t *rst,
    00130         const axutil_env_t *env);
    00131
    00132     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00133     trust_rst_set_claims(
    00134         trust_rst_t *rst,
    00135         const axutil_env_t *env,
    00136         trust_claims_t *claims);
    00137
    00138     AXIS2_EXTERN trust_entropy_t * AXIS2_CALL
    00139     trust_rst_get_entropy(
    00140         trust_rst_t *rst,
    00141         const axutil_env_t *env);
    00142
    00143     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00144     trust_rst_set_entropy(
    00145         trust_rst_t *rst,
    00146         const axutil_env_t *env,
    00147         trust_entropy_t *entropy);
    00148
    00149
    00150     AXIS2_EXTERN  trust_life_time_t * AXIS2_CALL
    00151     trust_rst_get_life_time(
    00152         trust_rst_t *rst,
    00153         const axutil_env_t *env);
    00154
    00155     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00156     trust_rst_set_life_time(
    00157         trust_rst_t *rst,
    00158         const axutil_env_t *env,
    00159         trust_life_time_t *life_time);
    00160
    00161
    00162     /*Key and Token Parameter Extensions*/
    00163
    00164     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00165     trust_rst_set_key_type(
    00166         trust_rst_t *rst,
    00167         const axutil_env_t *env,
    00168         axis2_char_t *key_type);
    00169
    00170     AXIS2_EXTERN axis2_char_t * AXIS2_CALL
    00171     trust_rst_get_key_type(
    00172         trust_rst_t *rst,
    00173         const axutil_env_t *env);
    00174
    00175
    00176     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00177     trust_rst_set_key_size(
    00178         trust_rst_t *rst,
    00179         const axutil_env_t *env,
    00180         int key_size);
    00181
    00182     AXIS2_EXTERN int AXIS2_CALL
    00183     trust_rst_get_key_size(
    00184         trust_rst_t *rst,
    00185         const axutil_env_t *env);
    00186
    00187
    00188
    00189     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00190     trust_rst_set_authentication_type(
    00191         trust_rst_t *rst,
    00192         const axutil_env_t *env,
    00193         axis2_char_t *authentication_type);
    00194
    00195     AXIS2_EXTERN axis2_char_t * AXIS2_CALL
    00196     trust_rst_get_authentication_type(
    00197         trust_rst_t *rst,
    00198         const axutil_env_t *env);
    00199
    00200
    00201     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00202     trust_rst_set_signature_algorithm(
    00203         trust_rst_t *rst,
    00204         const axutil_env_t *env,
    00205         axis2_char_t *signature_algorithm);
    00206
    00207     AXIS2_EXTERN axis2_char_t * AXIS2_CALL
    00208     trust_rst_get_signature_algorithm(
    00209         trust_rst_t *rst,
    00210         const axutil_env_t *env);
    00211
    00212
    00213     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00214     trust_rst_set_encryption_algorithm(
    00215         trust_rst_t *rst,
    00216         const axutil_env_t *env,
    00217         axis2_char_t *encryption_algorithm);
    00218
    00219     AXIS2_EXTERN axis2_char_t * AXIS2_CALL
    00220     trust_rst_get_encryption_algorithm(
    00221         trust_rst_t *rst,
    00222         const axutil_env_t *env);
    00223
    00224
    00225     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00226     trust_rst_set_canonicalization_algorithm(
    00227         trust_rst_t *rst,
    00228         const axutil_env_t *env,
    00229         axis2_char_t *canonicalization_algorithm);
    00230
    00231     AXIS2_EXTERN axis2_char_t * AXIS2_CALL
    00232     trust_rst_get_canonicalization_algorithm(
    00233         trust_rst_t *rst,
    00234         const axutil_env_t *env);
    00235
    00236
    00237     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00238     trust_rst_set_computedkey_algorithm(
    00239         trust_rst_t *rst,
    00240         const axutil_env_t *env,
    00241         axis2_char_t *computedkey_algorithm);
    00242
    00243     AXIS2_EXTERN axis2_char_t * AXIS2_CALL
    00244     trust_rst_get_computedkey_algorithm(
    00245         trust_rst_t *rst,
    00246         const axutil_env_t *env);
    00247
    00248
    00249
    00250     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00251     trust_rst_set_desired_encryption(
    00252         trust_rst_t *rst,
    00253         const axutil_env_t *env,
    00254         axiom_node_t *desired_encryption_key);
    00255
    00256     AXIS2_EXTERN axiom_node_t * AXIS2_CALL
    00257     trust_rst_get_desired_encryption(
    00258         trust_rst_t *rst,
    00259         const axutil_env_t *env);
    00260
    00261
    00262     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00263     trust_rst_set_proof_encryption(
    00264         trust_rst_t *rst,
    00265         const axutil_env_t *env,
    00266         axiom_node_t *proof_encryption_key);
    00267
    00268     AXIS2_EXTERN axiom_node_t * AXIS2_CALL
    00269     trust_rst_get_proof_encryption(
    00270         trust_rst_t *rst,
    00271         const axutil_env_t *env);
    00272
    00273     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00274     trust_rst_set_usekey(
    00275         trust_rst_t *rst,
    00276         const axutil_env_t *env,
    00277         axiom_node_t *usekey_key);
    00278
    00279     AXIS2_EXTERN axiom_node_t * AXIS2_CALL
    00280     trust_rst_get_usekey(
    00281         trust_rst_t *rst,
    00282         const axutil_env_t *env);
    00283     /*FIX Usekey attr @Sig*/
    00284
    00285
    00286     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00287     trust_rst_set_signwith(
    00288         trust_rst_t *rst,
    00289         const axutil_env_t *env,
    00290         axis2_char_t *signwith);
    00291
    00292     AXIS2_EXTERN axis2_char_t * AXIS2_CALL
    00293     trust_rst_get_signwith(
    00294         trust_rst_t *rst,
    00295         const axutil_env_t *env);
    00296
    00297
    00298
    00299     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00300     trust_rst_set_encryptwith(
    00301         trust_rst_t *rst,
    00302         const axutil_env_t *env,
    00303         axis2_char_t *encryptwith);
    00304
    00305     AXIS2_EXTERN axis2_char_t * AXIS2_CALL
    00306     trust_rst_get_encryptwith(
    00307         trust_rst_t *rst,
    00308         const axutil_env_t *env);
    00309
    00310
    00311     /*Trust Version 1 -2005/02 - http://schemas.xmlsoap.org/ws/2005/02/trust */
    00312     /*Trust Version 2 -2005/12 - http://docs.oasis-open.org/ws-sx/ws-trust/200512 */
    00313     AXIS2_EXTERN axis2_char_t * AXIS2_CALL
    00314     trust_rst_get_wst_ns_uri(
    00315         trust_rst_t *rst,
    00316         const axutil_env_t *env);
    00317
    00318     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00319     trust_rst_set_wst_ns_uri(
    00320         trust_rst_t *rst,
    00321         const axutil_env_t *env,
    00322         axis2_char_t *wst_ns_uri);
    00323
    00324
    00325
    00326
    00327     AXIS2_EXTERN void AXIS2_CALL
    00328     trust_rst_free(
    00329         trust_rst_t *rst,
    00330         const axutil_env_t *env);
    00331
    00332
    00333 #ifdef __cplusplus
    00334 }
    00335 #endif
    00336
    00337 #endif
    00338
    00339