# trust_util.h

Go to the documentation of this file.

    00001
    00002 /*
    00003 * Licensed to the Apache Software Foundation (ASF) under one or more
    00004 * contributor license agreements.  See the NOTICE file distributed with
    00005 * this work for additional information regarding copyright ownership.
    00006 * The ASF licenses this file to You under the Apache License, Version 2.0
    00007 * (the "License"); you may not use this file except in compliance with
    00008 * the License.  You may obtain a copy of the License at
    00009 *
    00010 *      http://www.apache.org/licenses/LICENSE-2.0
    00011 *
    00012 * Unless required by applicable law or agreed to in writing, software
    00013 * distributed under the License is distributed on an "AS IS" BASIS,
    00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00015 * See the License for the specific language governing permissions and
    00016 * limitations under the License.
    00017 */
    00018
    00019 #ifndef TRUST_UTIL
    00020 #define TRUST_UTIL
    00021
    00027 #include <stdio.h>
    00028 #include <stdlib.h>
    00029 #include <axiom.h>
    00030 #include <axutil_utils.h>
    00031 #include <axutil_string.h>
    00032
    00033 #include <trust_constants.h>
    00034
    00035 #ifdef __cplusplus
    00036 extern "C"
    00037 {
    00038 #endif
    00039
    00040     typedef enum
    00041     {
    00042         TRUST_ALLOW = 0,
    00043         TRUST_NOT_ALLOW
    00044     } trust_allow_t;
    00045
    00046     typedef enum
    00047     {
    00048         TRUST_OK = 0,
    00049         TRUST_NOT_OK
    00050     } trust_ok_t;
    00051
    00063     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00064     trust_util_create_rst_element(
    00065         const axutil_env_t * env,
    00066         axis2_char_t *wst_ns_uri,
    00067         axis2_char_t * context);
    00068
    00080     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00081     trust_util_create_rstr_element(
    00082         const axutil_env_t * env,
    00083         axis2_char_t *wst_ns_uri,
    00084         axis2_char_t * context);
    00085
    00096     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00097     trust_util_create_rstr_collection_element(
    00098         const axutil_env_t * env,
    00099         axis2_char_t *wst_ns_uri);
    00100
    00110     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00111     trust_util_create_request_type_element(
    00112         const axutil_env_t * env,
    00113         axis2_char_t *wst_ns_uri,
    00114         axiom_node_t * parent_node,
    00115         axis2_char_t * request_type);
    00116
    00126     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00127     trust_util_create_token_type_element(
    00128         const axutil_env_t * env,
    00129         axis2_char_t *wst_ns_uri,
    00130         axiom_node_t * parent_node,
    00131         axis2_char_t * token_type);
    00132
    00148     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00149     trust_util_create_applies_to_element(
    00150         const axutil_env_t * env,
    00151         axiom_node_t * parent_node,
    00152         const axis2_char_t * address,
    00153         const axis2_char_t * addressing_ns);
    00154
    00161     AXIS2_EXTERN axiom_node_t * AXIS2_CALL
    00162     trust_util_create_claims_element(
    00163         const axutil_env_t * env,
    00164         axis2_char_t *wst_ns_uri,
    00165         axiom_node_t * parent_node,
    00166         axis2_char_t * dialect_uri);
    00167
    00176     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00177     trust_util_create_requested_security_token_element(
    00178         const axutil_env_t * env,
    00179         axis2_char_t *wst_ns_uri,
    00180         axiom_node_t * parent_node,
    00181         axiom_node_t * sec_token_node);
    00182
    00183
    00192     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00193     trust_util_create_requsted_proof_token_element(
    00194         const axutil_env_t * env,
    00195         axis2_char_t *wst_ns_uri,
    00196         axiom_node_t * parent_node,
    00197         axiom_node_t *req_proof_token);
    00198
    00209     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00210     trust_util_create_entropy_element(
    00211         const axutil_env_t * env,
    00212         axis2_char_t *wst_ns_uri,
    00213         axiom_node_t * parent_node);
    00214
    00224     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00225     trust_util_computed_key_element(
    00226         const axutil_env_t * env,
    00227         axis2_char_t *wst_ns_uri,
    00228         axiom_node_t * parent_node);
    00229
    00240     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00241     trust_util_create_binary_secret_element(
    00242         const axutil_env_t * env,
    00243         axis2_char_t *wst_ns_uri,
    00244         axiom_node_t * parent_node,
    00245         axis2_char_t * enc_secret,
    00246         axis2_char_t * bin_sec_type);
    00247
    00256     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00257     trust_util_create_computed_key_algo_element(
    00258         const axutil_env_t * env,
    00259         axis2_char_t *wst_ns_uri,
    00260         axiom_node_t * parent_node,
    00261         axis2_char_t * algo_id);
    00262
    00271     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00272     trust_util_create_key_size_element(
    00273         const axutil_env_t * env,
    00274         axis2_char_t *wst_ns_uri,
    00275         axiom_node_t * parent_node,
    00276         axis2_char_t * key_size);
    00277
    00286     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00287     trust_util_create_key_type_element(
    00288         const axutil_env_t * env,
    00289         axis2_char_t *wst_ns_uri,
    00290         axiom_node_t * parent_node,
    00291         axis2_char_t * key_type);
    00292
    00293
    00294     /*AuthenticationType*/
    00295     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00296     trust_util_create_authentication_type_element(
    00297         const axutil_env_t * env,
    00298         axis2_char_t *wst_ns_uri,
    00299         axiom_node_t * parent_node,
    00300         axis2_char_t * authentication_type);
    00301
    00302    /*SignatureAlgorithm*/
    00303     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00304     trust_util_create_signature_algo_element(
    00305         const axutil_env_t * env,
    00306         axis2_char_t *wst_ns_uri,
    00307         axiom_node_t * parent_node,
    00308         axis2_char_t * signature_algo);
    00309
    00310     /*EncryptionAlgorithm*/
    00311     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00312     trust_util_create_encryption_algo_element(
    00313         const axutil_env_t * env,
    00314         axis2_char_t *wst_ns_uri,
    00315         axiom_node_t * parent_node,
    00316         axis2_char_t * encryption_algo);
    00317
    00318     /*CanonicalizationAlgorithm*/
    00319     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00320     trust_util_create_canonicalization_algo_element(
    00321         const axutil_env_t * env,
    00322         axis2_char_t *wst_ns_uri,
    00323         axiom_node_t * parent_node,
    00324         axis2_char_t * canonicalization_algo);
    00325
    00326     /*ComputedKeyAlgorithm*/
    00327     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00328     trust_util_create_computedkey_algo_element(
    00329         const axutil_env_t * env,
    00330         axis2_char_t *wst_ns_uri,
    00331         axiom_node_t * parent_node,
    00332         axis2_char_t * computedkey_algo);
    00333
    00334    /*(Desired)Encryption*/
    00335     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00336     trust_util_create_desired_encryption_element(
    00337         const axutil_env_t * env,
    00338         axis2_char_t * wst_ns_uri,
    00339         axiom_node_t * parent_node,
    00340         axiom_node_t * encryption_key); /*@param encryption_key - This can be either a key or a STR*/
    00341
    00342    /*ProofEncryption*/
    00343     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00344     trust_util_create_proof_encryption_element(
    00345         const axutil_env_t * env,
    00346         axis2_char_t * wst_ns_uri,
    00347         axiom_node_t * parent_node,
    00348         axiom_node_t * proof_encryption_key); /*@param encryption_key - This can be either a key or a STR*/
    00349
    00350     /*UseKey*/
    00351     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00352     trust_util_create_usekey_element(
    00353         const axutil_env_t * env,
    00354         axis2_char_t * wst_ns_uri,
    00355         axiom_node_t * parent_node,
    00356         axiom_node_t * usekey_key); /*@param encryption_key - This can be either a key or a STR*/
    00357
    00358    /*SignWith*/
    00359     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00360     trust_util_create_signwith_element(
    00361         const axutil_env_t * env,
    00362         axis2_char_t *wst_ns_uri,
    00363         axiom_node_t * parent_node,
    00364         axis2_char_t * signwith);
    00365
    00366    /*EncryptWith*/
    00367     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00368     trust_util_create_encryptwith_element(
    00369         const axutil_env_t * env,
    00370         axis2_char_t *wst_ns_uri,
    00371         axiom_node_t * parent_node,
    00372         axis2_char_t * encryptwith);
    00373
    00382     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00383     trust_util_create_life_time_element(
    00384         const axutil_env_t * env,
    00385         axiom_node_t * parent_node,
    00386         axis2_char_t *wst_ns_uri,
    00387         int ttl);
    00388
    00396     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00397     trust_util_create_req_attached_reference_element(
    00398         const axutil_env_t * env,
    00399         axis2_char_t *wst_ns_uri,
    00400         axiom_node_t * parent_node);
    00401
    00409     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00410     trust_util_create_req_unattached_reference_element(
    00411         const axutil_env_t * env,
    00412         axis2_char_t *wst_ns_uri,
    00413         axiom_node_t * parent_node);
    00414
    00423     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00424     trust_util_create_encrypted_data_element(
    00425         const axutil_env_t * env,
    00426         axiom_node_t * parent_node,
    00427         axis2_char_t * enc_data);
    00428
    00437     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00438     trust_util_create_renew_traget_element(
    00439         const axutil_env_t * env,
    00440         axis2_char_t *wst_ns_uri,
    00441         axiom_node_t * parent_node,
    00442         axiom_node_t * token_renew_pending_node);
    00443
    00451     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00452     trust_util_create_allow_postdating_element(
    00453         const axutil_env_t * env,
    00454         axis2_char_t *wst_ns_uri,
    00455         axiom_node_t * parent_node);
    00456
    00466     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00467     trust_util_create_renewing_element(
    00468         const axutil_env_t * env,
    00469         axis2_char_t *wst_ns_uri,
    00470         axiom_node_t * parent_node,
    00471         trust_allow_t allow_flag,
    00472         trust_ok_t ok_flag);
    00473
    00482     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00483     trust_util_create_cancel_target_element(
    00484         const axutil_env_t * env,
    00485         axis2_char_t *wst_ns_uri,
    00486         axiom_node_t * parent_node,
    00487         axiom_node_t * token_cancel_pending_node);
    00488
    00497     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    00498     trust_util_create_validation_response_element(
    00499         const axutil_env_t * env,
    00500         axiom_node_t * parent_node,
    00501         axis2_char_t *wst_ns_uri,
    00502         axis2_char_t * code,
    00503         axis2_char_t * reason);
    00504
    00505         /* Generate random se*/
    00506         AXIS2_EXTERN axiom_node_t * AXIS2_CALL
    00507         trust_util_create_random_session_key_proof_token_element(
    00508                 const axutil_env_t * env,
    00509                 axis2_char_t *wst_ns_uri);
    00510
    00517     AXIS2_EXTERN axis2_char_t *AXIS2_CALL
    00518     trust_util_get_wst_ns(
    00519         const axutil_env_t * env,
    00520         int wst_version);
    00521
    00522 #ifdef __cplusplus
    00523 }
    00524 #endif
    00525 #endif                          /*TRUST_UTIL_H */