axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manj...@apache.org
Subject svn commit: r529911 [1/3] - in /webservices/axis2/scratch/c/neethi/src/secpolicy: ./ builder/ model/
Date Wed, 18 Apr 2007 08:15:00 GMT
Author: manjula
Date: Wed Apr 18 01:14:56 2007
New Revision: 529911

URL: http://svn.apache.org/viewvc?view=rev&rev=529911
Log:
Adding required builders for neethi/c.

Added:
    webservices/axis2/scratch/c/neethi/src/secpolicy/
    webservices/axis2/scratch/c/neethi/src/secpolicy/builder/
    webservices/axis2/scratch/c/neethi/src/secpolicy/builder/transport_binding_builder.c
    webservices/axis2/scratch/c/neethi/src/secpolicy/builder/transport_token_builder.c
    webservices/axis2/scratch/c/neethi/src/secpolicy/model/
    webservices/axis2/scratch/c/neethi/src/secpolicy/model/algorithmsuite.c
    webservices/axis2/scratch/c/neethi/src/secpolicy/model/asymmetric_binding.c
    webservices/axis2/scratch/c/neethi/src/secpolicy/model/binding_commons.c
    webservices/axis2/scratch/c/neethi/src/secpolicy/model/element.c
    webservices/axis2/scratch/c/neethi/src/secpolicy/model/header.c
    webservices/axis2/scratch/c/neethi/src/secpolicy/model/https_token.c
    webservices/axis2/scratch/c/neethi/src/secpolicy/model/layout.c
    webservices/axis2/scratch/c/neethi/src/secpolicy/model/property.c
    webservices/axis2/scratch/c/neethi/src/secpolicy/model/rampart_config.c
    webservices/axis2/scratch/c/neethi/src/secpolicy/model/secpolicy.c
    webservices/axis2/scratch/c/neethi/src/secpolicy/model/security_context_token.c
    webservices/axis2/scratch/c/neethi/src/secpolicy/model/signed_encrypted_elements.c
    webservices/axis2/scratch/c/neethi/src/secpolicy/model/signed_encrypted_items.c
    webservices/axis2/scratch/c/neethi/src/secpolicy/model/signed_encrypted_parts.c
    webservices/axis2/scratch/c/neethi/src/secpolicy/model/supporting_tokens.c
    webservices/axis2/scratch/c/neethi/src/secpolicy/model/symmetric_asymmetric_binding_commons.c
    webservices/axis2/scratch/c/neethi/src/secpolicy/model/symmetric_binding.c
    webservices/axis2/scratch/c/neethi/src/secpolicy/model/transport_binding.c
    webservices/axis2/scratch/c/neethi/src/secpolicy/model/ut.c
    webservices/axis2/scratch/c/neethi/src/secpolicy/model/wss10.c
    webservices/axis2/scratch/c/neethi/src/secpolicy/model/wss11.c
    webservices/axis2/scratch/c/neethi/src/secpolicy/model/x509_token.c

Added: webservices/axis2/scratch/c/neethi/src/secpolicy/builder/transport_binding_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/src/secpolicy/builder/transport_binding_builder.c?view=auto&rev=529911
==============================================================================
--- webservices/axis2/scratch/c/neethi/src/secpolicy/builder/transport_binding_builder.c (added)
+++ webservices/axis2/scratch/c/neethi/src/secpolicy/builder/transport_binding_builder.c Wed Apr 18 01:14:56 2007
@@ -0,0 +1,167 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <rp_transport_binding_builder.h>
+#include <policy_operator.h>
+#include <policy.h>
+#include <policy_assertion.h>
+#include <policy_exactlyone.h>
+#include <policy_all.h>
+#include <policy_engine.h>
+
+/*private functions*/
+
+axis2_status_t AXIS2_CALL
+transport_binding_process_alternatives(
+        const axutil_env_t *env,
+        policy_all_t *all,
+        rp_transport_binding_t *transport_binding);
+
+/***********************************/
+
+
+AXIS2_EXTERN rp_transport_binding_t *AXIS2_CALL 
+transport_binding_builder_build(
+        const axutil_env_t *env,
+        axiom_node_t *node,
+        axiom_element_t *element)
+
+{
+    rp_transport_binding_t *transport_binding = NULL;
+    policy_t *policy = NULL;
+    axiom_node_t *child_node = NULL;
+    axiom_element *child_element = NULL;
+    axutil_array_list_t *alternatives = NULL;
+    policy_operator_t *component = NULL;
+    policy_all_t *all = NULL;
+
+    transport_binding = rp_transport_binding_create(env);
+    
+    child_node = axiom_node_get_first_element(node,env);
+
+    if(axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
+    {
+        child_element = (axiom_element_t*)axiom_node_get_data_element(child_node, env);
+        if(child_element)
+        {
+            policy = policy_engine_get_policy(env, child_node, child_element);
+            if(!policy)
+            {
+                return NULL;
+            }
+            policy = policy_engine_get_normalize(policy, AXIS2_FALSE, env); 
+            alternatives = policy_get_alternatives(policy, env);
+            component = (policy_operator_t *)axutil_array_list_get(alternatives, env, 0);            
+            all = (policy_all_t *)policy_operator_get_value(component ,env);
+            transport_binding_process_alternatives(env, all, transport_binding);
+
+            return transport_binding;
+        }
+        else return NULL;
+    }
+    else return NULL;
+}
+
+axis2_status_t AXIS2_CALL
+transport_binding_process_alternatives(
+        const axutil_env_t *env,
+        policy_all_t *all,
+        rp_transport_binding_t *transport_binding)
+{
+
+    policy_operator_t *operator = NULL;
+    axutil_array_list_t *arraylist = NULL;
+    policy_assertion_t *assertion = NULL;
+    policy_assertion_type_t *type;    
+    void *value = NULL;
+    rp_binding_commons_t *commons = NULL;
+
+    int i = 0;
+
+    arraylist = policy_all_get_policy_components(all, env);
+    commons = rp_binding_commons_create(env);    
+
+    for(i=0; i<axutil_array_list_size(arraylist, env); i++)
+    {
+        operator = (policy_operator_t *)axutil_array_list_get(arraylist, env, i);
+        assertion = (policy_assertion_t *)policy_operator_get_value(operator, env);
+        value = policy_assertion_get_value(assertion, env);
+        type = policy_assertion_get_type(assertion, env);
+
+        if(value)
+        {
+            if(type == ASSERTION_TYPE_TRANSPORT_TOKEN)
+            {
+                rp_property_t *transport_token = NULL;    
+                transport_token = (rp_property_t *)policy_assertion_get_value(assertion, env);
+                if(transport_token)
+                {
+                    rp_transport_binding_set_transport_token(transport_binding, env, transport_token);
+                }
+                else return AXIS2_FAILURE;
+            }
+            else if(type == ASSERTION_TYPE_ALGORITHM_SUITE)
+            {
+                rp_algorithmsuite_t *algorithmsuite = NULL;
+                algorithmsuite = (rp_algorithmsuite_t *)policy_assertion_get_value(assertion, env);
+                if(algorithmsuite)
+                {
+                    rp_binding_commons_set_algorithmsuite(commons, env, algorithmsuite);
+                }                
+                else return AXIS2_FAILURE;
+            }
+            else if(type == ASSERTION_TYPE_INCLUDE_TIMESTAMP)
+            {
+                rp_binding_commons_set_include_timestamp(commons, env, AXIS2_TRUE);
+            }
+            else if(type == ASSERTION_TYPE_LAYOUT)
+            {
+                rp_layout_t *layout = NULL;
+                layout = (rp_layout_t *)policy_assertion_get_value(assertion, env);
+                if(layout)
+                {
+                    rp_binding_commons_set_layout(commons, env, layout);
+                }                    
+                else return AXIS2_FAILURE;
+            }
+            else if(type == ASSERTION_TYPE_SIGNED_SUPPORTING_TOKENS)
+            {
+                rp_supporting_tokens_t *signed_supporting_tokens = NULL;
+                signed_supporting_tokens = (rp_supporting_tokens_t *)policy_assertion_get_value(assertion, env);
+                if(signed_supporting_tokens)
+                {
+                    rp_binding_commons_set_signed_supporting_tokens(commons, env, signed_supporting_tokens);
+                }                    
+                else return AXIS2_FAILURE;
+            }
+            else if(type == ASSERTION_TYPE_SIGNED_ENDORSING_SUPPORTING_TOKENS)
+            {
+                rp_supporting_tokens_t *signed_endorsing_supporting_tokens = NULL;
+                signed_endorsing_supporting_tokens = (rp_supporting_tokens_t *)policy_assertion_get_value(assertion, env);
+                if(signed_endorsing_supporting_tokens)
+                {
+                    rp_binding_commons_set_signed_endorsing_supporting_tokens(commons, env, signed_endorsing_supporting_tokens);
+                }
+                else return AXIS2_FAILURE;
+            }                
+            else return AXIS2_FAILURE;
+        }        
+        else return AXIS2_FAILURE;
+    }
+    rp_transport_binding_set_binding_commons(transport_binding, env, commons);
+    return AXIS2_SUCCESS;
+}

Added: webservices/axis2/scratch/c/neethi/src/secpolicy/builder/transport_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/src/secpolicy/builder/transport_token_builder.c?view=auto&rev=529911
==============================================================================
--- webservices/axis2/scratch/c/neethi/src/secpolicy/builder/transport_token_builder.c (added)
+++ webservices/axis2/scratch/c/neethi/src/secpolicy/builder/transport_token_builder.c Wed Apr 18 01:14:56 2007
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <rp_transport_token_builder.h>
+#include <policy_operator.h>
+#include <policy.h>
+#include <policy_assertion.h>
+#include <policy_exactlyone.h>
+#include <policy_all.h>
+#include <policy_engine.h>
+
+/*private functions*/
+
+axis2_status_t AXIS2_CALL
+transport_token_process_alternatives(
+        const axutil_env_t *env,
+        policy_all_t *all,
+        rp_property_t *transport_token);
+
+/***********************************/
+
+
+AXIS2_EXTERN rp_property_t *AXIS2_CALL 
+transport_token_builder_build(
+        const axutil_env_t *env,
+        axiom_node_t *node,
+        axiom_element_t *element)
+
+{
+    rp_property_t *transport_token = NULL;
+    policy_t *policy = NULL;
+    axiom_node_t *child_node = NULL;
+    axiom_element *child_element = NULL;
+    axutil_array_list_t *alternatives = NULL;
+    policy_operator_t *component = NULL;
+    policy_all_t *all = NULL;
+
+    transport_token = rp_property_create(env);
+    
+    child_node = axiom_node_get_first_element(node,env);
+
+    if(axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
+    {
+        child_element = (axiom_element_t*)axiom_node_get_data_element(child_node, env);
+        if(child_element)
+        {
+            policy = policy_engine_get_policy(env, child_node, child_element);
+            if(!policy)
+            {
+                return NULL;
+            }
+            policy = policy_engine_get_normalize(policy, AXIS2_FALSE, env); 
+            alternatives = policy_get_alternatives(policy, env);
+            component = (policy_operator_t *)axutil_array_list_get(alternatives, env, 0);            
+            all = (policy_all_t *)policy_operator_get_value(component ,env);
+            transport_token_process_alternatives(env, all, transport_token);
+
+            return transport_token;
+        }
+        else return NULL;
+    }
+    else return NULL;
+}
+
+axis2_status_t AXIS2_CALL
+transport_token_process_alternatives(
+        const axutil_env_t *env,
+        policy_all_t *all,
+        rp_property_t *transport_token)
+{
+
+    policy_operator_t *operator = NULL;
+    axutil_array_list_t *arraylist = NULL;
+    policy_assertion_t *assertion = NULL;
+    policy_assertion_type_t *type;    
+    void *value = NULL;
+
+    int i = 0;
+
+    arraylist = policy_all_get_policy_components(all, env);
+
+    for(i=0; i<axutil_array_list_size(arraylist, env); i++)
+    {
+        operator = (policy_operator_t *)axutil_array_list_get(arraylist, env, i);
+        assertion = (policy_assertion_t *)policy_operator_get_value(operator, env);
+        value = policy_assertion_get_value(assertion, env);
+        type = policy_assertion_get_type(assertion, env);
+
+        if(value)
+        {
+            if(type == ASSERTION_TYPE_HTTPS_TOKEN)
+            {
+                rp_https_token_t *https_token = NULL;    
+                https_token = (rp_https_token_t *)policy_assertion_get_value(assertion, env);
+                if(https_token)
+                {
+                    rp_property_set_value(transport_token, env, https_token, RP_TOKEN_HTTPS);
+                }
+                else return AXIS2_FAILURE;
+            }
+            else return AXIS2_FAILURE;
+        }
+        else return AXIS2_FAILURE;
+    }        
+    return AXIS2_SUCCESS;
+}

Added: webservices/axis2/scratch/c/neethi/src/secpolicy/model/algorithmsuite.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/src/secpolicy/model/algorithmsuite.c?view=auto&rev=529911
==============================================================================
--- webservices/axis2/scratch/c/neethi/src/secpolicy/model/algorithmsuite.c (added)
+++ webservices/axis2/scratch/c/neethi/src/secpolicy/model/algorithmsuite.c Wed Apr 18 01:14:56 2007
@@ -0,0 +1,594 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <rp_algorithmsuite.h>
+
+struct rp_algorithmsuite_t
+{
+    axis2_char_t *algosuite_string;
+    axis2_char_t *symmetric_signature;
+    axis2_char_t *asymmetric_signature;
+    axis2_char_t *computed_key;
+    int max_symmetric_keylength;
+    int min_asymmetric_keylength;
+    int max_asymmetric_keylength;
+    axis2_char_t *digest;
+    axis2_char_t *encryption;
+    axis2_char_t *symmetrickeywrap;
+    axis2_char_t *asymmetrickeywrap;
+    axis2_char_t *encryption_key_derivation;
+    axis2_char_t *signature_key_derivation;
+    int min_symmetric_keylength;
+    axis2_char_t *c14n;
+    axis2_char_t *soap_normalization;
+    axis2_char_t *str_transformation;
+    axis2_char_t *xpath;
+
+};
+
+AXIS2_EXTERN rp_algorithmsuite_t *AXIS2_CALL 
+rp_algorithmsuite_create(const axutil_env_t *env)
+{
+    rp_algorithmsuite_t *algorithmsuite = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+
+    algorithmsuite =  (rp_algorithmsuite_t *) AXIS2_MALLOC (env->allocator,
+    sizeof (rp_algorithmsuite_t));
+
+    if(algorithmsuite == NULL)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    algorithmsuite->algosuite_string = NULL;
+    algorithmsuite->symmetric_signature = RP_HMAC_SHA1;
+    algorithmsuite->asymmetric_signature = RP_RSA_SHA1;
+    algorithmsuite->computed_key = RP_P_SHA1;
+    algorithmsuite->max_symmetric_keylength = 256;
+    algorithmsuite->min_asymmetric_keylength = 1024;
+    algorithmsuite->max_asymmetric_keylength = 4096;
+    algorithmsuite->digest = NULL;
+    algorithmsuite->encryption = NULL;
+    algorithmsuite->symmetrickeywrap = NULL;
+    algorithmsuite->asymmetrickeywrap = NULL;
+    algorithmsuite->encryption_key_derivation = NULL;
+    algorithmsuite->signature_key_derivation = NULL;
+    algorithmsuite->min_symmetric_keylength = 0;;
+    algorithmsuite->c14n = RP_EX_C14N;
+    algorithmsuite->soap_normalization = NULL;
+    algorithmsuite->str_transformation = NULL;
+    algorithmsuite->xpath = NULL;
+
+    return algorithmsuite;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_algorithmsuite_free(rp_algorithmsuite_t *algorithmsuite,
+        const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+        
+    if(algorithmsuite)
+    {
+        AXIS2_FREE(env->allocator, algorithmsuite);
+        algorithmsuite = NULL;
+    }
+    return AXIS2_SUCCESS;
+}
+
+
+/* Implementations */
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL 
+rp_algorithmsuite_get_algosuite_string(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    if(!algorithmsuite)
+        return NULL;
+    else
+        return algorithmsuite->algosuite_string;
+    
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_algorithmsuite_set_algosuite(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env,
+            axis2_char_t *algosuite_string)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,algosuite_string,AXIS2_FAILURE);   
+ 
+    algorithmsuite->algosuite_string = algosuite_string;
+
+    if(axutil_strcmp(algosuite_string,RP_ALGO_SUITE_BASIC256)==0)
+    {
+        algorithmsuite->digest = RP_SHA1;
+        algorithmsuite->encryption = RP_AES256;
+        algorithmsuite->symmetrickeywrap = RP_KW_AES256;
+        algorithmsuite->asymmetrickeywrap = RP_KW_RSA_OAEP;
+        algorithmsuite->encryption_key_derivation = RP_P_SHA1_L256;
+        algorithmsuite->signature_key_derivation = RP_P_SHA1_L192;
+        algorithmsuite->min_symmetric_keylength = 256;
+
+        return AXIS2_SUCCESS;
+    }
+    else if(axutil_strcmp(algosuite_string,RP_ALGO_SUITE_BASIC192)==0)
+    {
+        algorithmsuite->digest = RP_SHA1;
+        algorithmsuite->encryption = RP_AES192;
+        algorithmsuite->symmetrickeywrap = RP_KW_AES192;
+        algorithmsuite->asymmetrickeywrap = RP_KW_RSA_OAEP;
+        algorithmsuite->encryption_key_derivation = RP_P_SHA1_L192;
+        algorithmsuite->signature_key_derivation = RP_P_SHA1_L192;
+        algorithmsuite->min_symmetric_keylength = 192;
+
+        return AXIS2_SUCCESS;
+    }        
+    else if(axutil_strcmp(algosuite_string,RP_ALGO_SUITE_BASIC128)==0)
+    {
+        algorithmsuite->digest = RP_SHA1;
+        algorithmsuite->encryption = RP_AES128;
+        algorithmsuite->symmetrickeywrap = RP_KW_AES128;
+        algorithmsuite->asymmetrickeywrap = RP_KW_RSA_OAEP;
+        algorithmsuite->encryption_key_derivation = RP_P_SHA1_L128;
+        algorithmsuite->signature_key_derivation = RP_P_SHA1_L128;
+        algorithmsuite->min_symmetric_keylength = 128;
+
+        return AXIS2_SUCCESS;
+    }
+    else if(axutil_strcmp(algosuite_string,RP_ALGO_SUITE_TRIPLE_DES)==0)
+    {
+        algorithmsuite->digest = RP_SHA1;
+        algorithmsuite->encryption = RP_TRIPLE_DES;
+        algorithmsuite->symmetrickeywrap = RP_KW_TRIPLE_DES;
+        algorithmsuite->asymmetrickeywrap = RP_KW_RSA_OAEP;
+        algorithmsuite->encryption_key_derivation = RP_P_SHA1_L192;
+        algorithmsuite->signature_key_derivation = RP_P_SHA1_L192;
+        algorithmsuite->min_symmetric_keylength = 192;
+
+        return AXIS2_SUCCESS;
+    }
+    else if(axutil_strcmp(algosuite_string,RP_ALGO_SUITE_BASIC256_RSA15)==0)
+    {
+        algorithmsuite->digest = RP_SHA1;
+        algorithmsuite->encryption = RP_AES256;
+        algorithmsuite->symmetrickeywrap = RP_KW_AES256;
+        algorithmsuite->asymmetrickeywrap = RP_KW_RSA15;
+        algorithmsuite->encryption_key_derivation = RP_P_SHA1_L256;
+        algorithmsuite->signature_key_derivation = RP_P_SHA1_L192;
+        algorithmsuite->min_symmetric_keylength = 256;
+
+        return AXIS2_SUCCESS;
+    }
+    else if(axutil_strcmp(algosuite_string,RP_ALGO_SUITE_BASIC192_RSA15)==0)
+    {
+        algorithmsuite->digest = RP_SHA1;
+        algorithmsuite->encryption = RP_AES192;
+        algorithmsuite->symmetrickeywrap = RP_KW_AES192;
+        algorithmsuite->asymmetrickeywrap = RP_KW_RSA15;
+        algorithmsuite->encryption_key_derivation = RP_P_SHA1_L192;
+        algorithmsuite->signature_key_derivation = RP_P_SHA1_L192;
+        algorithmsuite->min_symmetric_keylength = 192;
+
+        return AXIS2_SUCCESS;
+    }
+    else if(axutil_strcmp(algosuite_string,RP_ALGO_SUITE_BASIC128_RSA15)==0)
+    {
+        algorithmsuite->digest = RP_SHA1;
+        algorithmsuite->encryption = RP_AES128;
+        algorithmsuite->symmetrickeywrap = RP_KW_AES128;
+        algorithmsuite->asymmetrickeywrap = RP_KW_RSA15;
+        algorithmsuite->encryption_key_derivation = RP_P_SHA1_L128;
+        algorithmsuite->signature_key_derivation = RP_P_SHA1_L128;
+        algorithmsuite->min_symmetric_keylength = 128;
+
+        return AXIS2_SUCCESS;
+    }
+    else if(axutil_strcmp(algosuite_string,RP_ALGO_SUITE_TRIPLE_DES_RSA15)==0)
+    {
+        algorithmsuite->digest = RP_SHA1;
+        algorithmsuite->encryption = RP_TRIPLE_DES;
+        algorithmsuite->symmetrickeywrap = RP_KW_TRIPLE_DES;
+        algorithmsuite->asymmetrickeywrap = RP_KW_RSA15;
+        algorithmsuite->encryption_key_derivation = RP_P_SHA1_L192;
+        algorithmsuite->signature_key_derivation = RP_P_SHA1_L192;
+        algorithmsuite->min_symmetric_keylength = 192;
+
+        return AXIS2_SUCCESS;
+    }
+    else if(axutil_strcmp(algosuite_string,RP_ALGO_SUITE_BASIC256_SHA256)==0)
+    {
+        algorithmsuite->digest = RP_SHA256;
+        algorithmsuite->encryption = RP_AES256;
+        algorithmsuite->symmetrickeywrap = RP_KW_AES256;
+        algorithmsuite->asymmetrickeywrap = RP_KW_RSA_OAEP;
+        algorithmsuite->encryption_key_derivation = RP_P_SHA1_L256;
+        algorithmsuite->signature_key_derivation = RP_P_SHA1_L192;
+        algorithmsuite->min_symmetric_keylength = 256;
+
+        return AXIS2_SUCCESS;
+    }
+    else if(axutil_strcmp(algosuite_string,RP_ALGO_SUITE_BASIC192_SHA256)==0)
+    {
+        algorithmsuite->digest = RP_SHA256;
+        algorithmsuite->encryption = RP_AES192;
+        algorithmsuite->symmetrickeywrap = RP_KW_AES192;
+        algorithmsuite->asymmetrickeywrap = RP_KW_RSA_OAEP;
+        algorithmsuite->encryption_key_derivation = RP_P_SHA1_L192;
+        algorithmsuite->signature_key_derivation = RP_P_SHA1_L192;
+        algorithmsuite->min_symmetric_keylength = 192;
+
+        return AXIS2_SUCCESS;
+    }
+    else if(axutil_strcmp(algosuite_string,RP_ALGO_SUITE_BASIC128_SHA256)==0)
+    {
+        algorithmsuite->digest = RP_SHA256;
+        algorithmsuite->encryption = RP_AES128;
+        algorithmsuite->symmetrickeywrap = RP_KW_AES128;
+        algorithmsuite->asymmetrickeywrap = RP_KW_RSA_OAEP;
+        algorithmsuite->encryption_key_derivation = RP_P_SHA1_L128;
+        algorithmsuite->signature_key_derivation = RP_P_SHA1_L128;
+        algorithmsuite->min_symmetric_keylength = 128;
+
+        return AXIS2_SUCCESS;
+    }
+    else if(axutil_strcmp(algosuite_string,RP_ALGO_SUITE_TRIPLE_DES_SHA256)==0)
+    {
+        algorithmsuite->digest = RP_SHA256;
+        algorithmsuite->encryption = RP_TRIPLE_DES;
+        algorithmsuite->symmetrickeywrap = RP_KW_TRIPLE_DES;
+        algorithmsuite->asymmetrickeywrap = RP_KW_RSA_OAEP;
+        algorithmsuite->encryption_key_derivation = RP_P_SHA1_L192;
+        algorithmsuite->signature_key_derivation = RP_P_SHA1_L192;
+        algorithmsuite->min_symmetric_keylength = 192;
+
+        return AXIS2_SUCCESS;
+    }
+    else if(axutil_strcmp(algosuite_string,RP_ALGO_SUITE_BASIC256_SHA256_RSA15)==0)
+    {
+        algorithmsuite->digest = RP_SHA256;
+        algorithmsuite->encryption = RP_AES256;
+        algorithmsuite->symmetrickeywrap = RP_KW_AES256;
+        algorithmsuite->asymmetrickeywrap = RP_KW_RSA15;
+        algorithmsuite->encryption_key_derivation = RP_P_SHA1_L256;
+        algorithmsuite->signature_key_derivation = RP_P_SHA1_L192;
+        algorithmsuite->min_symmetric_keylength = 256;
+
+        return AXIS2_SUCCESS;
+    }
+    else if(axutil_strcmp(algosuite_string,RP_ALGO_SUITE_BASIC192_SHA256_RSA15)==0)
+    {
+        algorithmsuite->digest = RP_SHA256;
+        algorithmsuite->encryption = RP_AES192;
+        algorithmsuite->symmetrickeywrap = RP_KW_AES192;
+        algorithmsuite->asymmetrickeywrap = RP_KW_RSA15;
+        algorithmsuite->encryption_key_derivation = RP_P_SHA1_L192;
+        algorithmsuite->signature_key_derivation = RP_P_SHA1_L192;
+        algorithmsuite->min_symmetric_keylength = 192;
+
+        return AXIS2_SUCCESS;
+    }
+    else if(axutil_strcmp(algosuite_string,RP_ALGO_SUITE_BASIC128_SHA256_RSA15)==0)
+    {
+        algorithmsuite->digest = RP_SHA256;
+        algorithmsuite->encryption = RP_AES128;
+        algorithmsuite->symmetrickeywrap = RP_KW_AES128;
+        algorithmsuite->asymmetrickeywrap = RP_KW_RSA15;
+        algorithmsuite->encryption_key_derivation = RP_P_SHA1_L128;
+        algorithmsuite->signature_key_derivation = RP_P_SHA1_L128;
+        algorithmsuite->min_symmetric_keylength = 128;
+
+        return AXIS2_SUCCESS;
+    }
+    else if(axutil_strcmp(algosuite_string,RP_ALGO_SUITE_TRIPLE_DES_SHA256_RSA15)==0)
+    {
+        algorithmsuite->digest = RP_SHA256;
+        algorithmsuite->encryption = RP_TRIPLE_DES;
+        algorithmsuite->symmetrickeywrap = RP_KW_TRIPLE_DES;
+        algorithmsuite->asymmetrickeywrap = RP_KW_RSA15;
+        algorithmsuite->encryption_key_derivation = RP_P_SHA1_L192;
+        algorithmsuite->signature_key_derivation = RP_P_SHA1_L192;
+        algorithmsuite->min_symmetric_keylength = 192;
+
+        return AXIS2_SUCCESS;
+    }
+    else
+        return AXIS2_FAILURE;
+}
+
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL 
+rp_algorithmsuite_get_symmetric_signature(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    return algorithmsuite->symmetric_signature;
+    
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_algorithmsuite_set_symmetric_signature(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env,
+            axis2_char_t *symmetric_signature)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,symmetric_signature,AXIS2_FAILURE);
+    
+    algorithmsuite->symmetric_signature = symmetric_signature;
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL 
+rp_algorithmsuite_get_asymmetric_signature(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    return algorithmsuite->asymmetric_signature;
+    
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_algorithmsuite_set_asymmetric_signature(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env,
+            axis2_char_t *asymmetric_signature)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,asymmetric_signature,AXIS2_FAILURE);
+    
+    algorithmsuite->asymmetric_signature = asymmetric_signature;
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL 
+rp_algorithmsuite_get_computed_key(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    return algorithmsuite->computed_key;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_algorithmsuite_set_computed_key(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env,
+            axis2_char_t *computed_key)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,computed_key,AXIS2_FAILURE);    
+    
+    algorithmsuite->computed_key = computed_key;
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL 
+rp_algorithmsuite_get_digest(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    return algorithmsuite->digest;
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL 
+rp_algorithmsuite_get_encryption(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+    return algorithmsuite->encryption;
+}
+
+AXIS2_EXTERN int AXIS2_CALL 
+rp_algorithmsuite_get_max_symmetric_keylength(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    return algorithmsuite->max_symmetric_keylength;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_algorithmsuite_set_max_symmetric_keylength(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env,
+            int max_symmetric_keylength)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+    algorithmsuite->max_symmetric_keylength = max_symmetric_keylength;
+
+    return AXIS2_SUCCESS;
+    
+}
+
+AXIS2_EXTERN int AXIS2_CALL 
+rp_algorithmsuite_get_min_symmetric_keylength(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    return algorithmsuite->min_symmetric_keylength;
+}
+
+AXIS2_EXTERN int AXIS2_CALL 
+rp_algorithmsuite_get_max_asymmetric_keylength(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    return algorithmsuite->max_asymmetric_keylength;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_algorithmsuite_set_max_asymmetric_keylength(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env,
+            int max_asymmetric_keylength)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+        
+    algorithmsuite->max_asymmetric_keylength = max_asymmetric_keylength;
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN int AXIS2_CALL 
+rp_algorithmsuite_get_min_asymmetric_keylength(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    return algorithmsuite->min_asymmetric_keylength;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_algorithmsuite_set_min_asymmetric_keylength(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env,
+            int min_asymmetric_keylength)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    algorithmsuite->min_asymmetric_keylength = min_asymmetric_keylength;
+    return AXIS2_SUCCESS;
+    
+}
+
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL 
+rp_algorithmsuite_get_symmetrickeywrap(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    return algorithmsuite->symmetrickeywrap;
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL 
+rp_algorithmsuite_get_asymmetrickeywrap(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    return algorithmsuite->asymmetrickeywrap;
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL 
+rp_algorithmsuite_get_signature_key_derivation(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    return algorithmsuite->signature_key_derivation;
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL 
+rp_algorithmsuite_get_encryption_key_derivation(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+        
+    return algorithmsuite->encryption_key_derivation;
+    
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL 
+rp_algorithmsuite_get_soap_normalization(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    return algorithmsuite->soap_normalization;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_algorithmsuite_set_soap_normalization(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env,
+            axis2_char_t *soap_normalization)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,soap_normalization,AXIS2_FAILURE);    
+    
+    algorithmsuite->soap_normalization = soap_normalization;
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL 
+rp_algorithmsuite_get_str_transformation(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    return algorithmsuite->str_transformation;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_algorithmsuite_set_str_transformation(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env,
+            axis2_char_t *str_transformation)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,str_transformation,AXIS2_FAILURE);    
+    
+    algorithmsuite->str_transformation = str_transformation;
+
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL 
+rp_algorithmsuite_get_c14n(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    return algorithmsuite->c14n;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_algorithmsuite_set_c14n(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env,
+            axis2_char_t *c14n)
+{
+        AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+        AXIS2_PARAM_CHECK(env->error,c14n,AXIS2_FAILURE);   
+ 
+    algorithmsuite->c14n = c14n;
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL 
+rp_algorithmsuite_get_xpath(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+        
+    return algorithmsuite->xpath;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_algorithmsuite_set_xpath(rp_algorithmsuite_t *algorithmsuite,
+            const axutil_env_t *env,
+            axis2_char_t *xpath)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,xpath,AXIS2_FAILURE);
+    
+    algorithmsuite->xpath = xpath;
+    return AXIS2_SUCCESS;
+}

Added: webservices/axis2/scratch/c/neethi/src/secpolicy/model/asymmetric_binding.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/src/secpolicy/model/asymmetric_binding.c?view=auto&rev=529911
==============================================================================
--- webservices/axis2/scratch/c/neethi/src/secpolicy/model/asymmetric_binding.c (added)
+++ webservices/axis2/scratch/c/neethi/src/secpolicy/model/asymmetric_binding.c Wed Apr 18 01:14:56 2007
@@ -0,0 +1,156 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <rp_asymmetric_binding.h>
+
+struct rp_asymmetric_binding_t
+{
+    rp_symmetric_asymmetric_binding_commons_t *symmetric_asymmetric_binding_commons;
+    rp_property_t *initiator_token;
+    rp_property_t *recipient_token;
+};
+
+AXIS2_EXTERN rp_asymmetric_binding_t *AXIS2_CALL 
+rp_asymmetric_binding_create(const axutil_env_t *env)
+{
+    rp_asymmetric_binding_t *asymmetric_binding = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+
+    asymmetric_binding =  (rp_asymmetric_binding_t *) AXIS2_MALLOC (env->allocator,
+    sizeof (rp_asymmetric_binding_t));
+
+    if(asymmetric_binding == NULL)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    asymmetric_binding->symmetric_asymmetric_binding_commons = NULL;
+    asymmetric_binding->initiator_token = NULL;
+    asymmetric_binding->recipient_token = NULL;
+    
+    return asymmetric_binding;
+
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_asymmetric_binding_free(
+    rp_asymmetric_binding_t *asymmetric_binding,
+    const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    if(asymmetric_binding)
+    {
+        if(asymmetric_binding->symmetric_asymmetric_binding_commons)
+        {
+            rp_symmetric_asymmetric_binding_commons_free(
+                asymmetric_binding->symmetric_asymmetric_binding_commons,
+                env);
+            asymmetric_binding->symmetric_asymmetric_binding_commons=NULL;
+        }
+        if(asymmetric_binding->initiator_token)
+        {
+            rp_property_free(asymmetric_binding->initiator_token,env);
+            asymmetric_binding->initiator_token = NULL;
+        }
+        if(asymmetric_binding->recipient_token)
+        {
+            rp_property_free(asymmetric_binding->recipient_token,env);            
+            asymmetric_binding->recipient_token = NULL;
+        }
+        AXIS2_FREE(env->allocator,asymmetric_binding);           
+    }
+
+    return AXIS2_SUCCESS;
+}
+
+
+/* Implementations */
+
+AXIS2_EXTERN rp_symmetric_asymmetric_binding_commons_t *AXIS2_CALL
+rp_asymmetric_binding_get_symmetric_asymmetric_binding_commons(
+    rp_asymmetric_binding_t *asymmetric_binding,
+    const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, NULL);
+
+    return asymmetric_binding->symmetric_asymmetric_binding_commons;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_asymmetric_binding_set_symmetric_asymmetric_binding_commons(
+    rp_asymmetric_binding_t *asymmetric_binding,
+    const axutil_env_t *env,
+    rp_symmetric_asymmetric_binding_commons_t *symmetric_asymmetric_binding_commons)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,symmetric_asymmetric_binding_commons,AXIS2_FAILURE);
+        
+    asymmetric_binding->symmetric_asymmetric_binding_commons
+            =symmetric_asymmetric_binding_commons;
+    return AXIS2_SUCCESS;
+}
+
+
+AXIS2_EXTERN rp_property_t *AXIS2_CALL
+rp_asymmetric_binding_get_initiator_token(
+    rp_asymmetric_binding_t *asymmetric_binding,
+    const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, NULL);
+        
+    return asymmetric_binding->initiator_token;
+}
+
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_asymmetric_binding_set_initiator_token(rp_asymmetric_binding_t *asymmetric_binding,
+    const axutil_env_t *env,
+    rp_property_t *initiator_token)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,initiator_token,AXIS2_FAILURE);
+    asymmetric_binding->initiator_token =initiator_token; 
+    return AXIS2_SUCCESS;
+
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_asymmetric_binding_set_recipient_token(
+    rp_asymmetric_binding_t *asymmetric_binding,
+    const axutil_env_t *env,
+    rp_property_t *recipient_token)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,recipient_token,AXIS2_FAILURE);
+    
+    asymmetric_binding->recipient_token = recipient_token; 
+    return AXIS2_SUCCESS;
+    
+}
+
+AXIS2_EXTERN rp_property_t *AXIS2_CALL
+rp_asymmetric_binding_get_recipient_token(
+    rp_asymmetric_binding_t *asymmetric_binding,
+    const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, NULL);
+        
+    return asymmetric_binding->recipient_token;
+}

Added: webservices/axis2/scratch/c/neethi/src/secpolicy/model/binding_commons.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/src/secpolicy/model/binding_commons.c?view=auto&rev=529911
==============================================================================
--- webservices/axis2/scratch/c/neethi/src/secpolicy/model/binding_commons.c (added)
+++ webservices/axis2/scratch/c/neethi/src/secpolicy/model/binding_commons.c Wed Apr 18 01:14:56 2007
@@ -0,0 +1,265 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <rp_binding_commons.h>
+
+struct rp_binding_commons_t
+{
+    rp_algorithmsuite_t *algorithmsuite;
+    axis2_bool_t include_timestamp;
+    rp_layout_t *layout;
+    rp_supporting_tokens_t *signed_supporting_tokens;
+    rp_supporting_tokens_t *signed_endorsing_supporting_tokens;
+    rp_supporting_tokens_t *endorsing_supporting_tokens;
+    rp_supporting_tokens_t *supporting_tokens;
+};
+
+AXIS2_EXTERN rp_binding_commons_t *AXIS2_CALL 
+rp_binding_commons_create(const axutil_env_t *env)
+{
+    rp_binding_commons_t *binding_commons = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+
+    binding_commons =  (rp_binding_commons_t *) AXIS2_MALLOC (env->allocator,
+    sizeof (rp_binding_commons_t));
+
+    if(binding_commons == NULL)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    binding_commons->algorithmsuite = NULL;
+    binding_commons->include_timestamp = AXIS2_FALSE;
+    binding_commons->layout = NULL;
+    binding_commons->signed_supporting_tokens = NULL;
+    binding_commons->signed_endorsing_supporting_tokens = NULL;
+    binding_commons->endorsing_supporting_tokens = NULL;
+    binding_commons->supporting_tokens = NULL;
+
+    return binding_commons;
+
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_binding_commons_free(rp_binding_commons_t *binding_commons,
+        const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    if(binding_commons)
+    {
+        
+        if(binding_commons->algorithmsuite)
+        {
+            rp_algorithmsuite_free(binding_commons->algorithmsuite,env);
+            binding_commons->algorithmsuite = NULL;
+        }
+        if(binding_commons->layout)
+        {
+            rp_layout_free(binding_commons->layout,env);
+            binding_commons->layout = NULL;
+        }
+        if(binding_commons->signed_supporting_tokens)
+        {
+            rp_supporting_tokens_free(binding_commons->signed_supporting_tokens,env);
+            binding_commons->signed_supporting_tokens = NULL;
+        }
+        if(binding_commons->signed_endorsing_supporting_tokens)
+        {
+            rp_supporting_tokens_free(binding_commons->signed_endorsing_supporting_tokens,env);
+            binding_commons->signed_endorsing_supporting_tokens = NULL;
+        }      
+        if(binding_commons->endorsing_supporting_tokens)
+        {
+            rp_supporting_tokens_free(binding_commons->endorsing_supporting_tokens,env);
+            binding_commons->endorsing_supporting_tokens = NULL;
+        }
+        if(binding_commons->supporting_tokens)
+        {
+            rp_supporting_tokens_free(binding_commons->supporting_tokens,env);
+            binding_commons->supporting_tokens = NULL;
+        }            
+        AXIS2_FREE(env->allocator,binding_commons);
+        binding_commons = NULL;
+
+    }
+    return AXIS2_SUCCESS;
+}
+
+
+/* Implementations */
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL 
+rp_binding_commons_get_include_timestamp(rp_binding_commons_t *binding_commons,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    return binding_commons->include_timestamp;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_binding_commons_set_include_timestamp(rp_binding_commons_t *binding_commons,
+            const axutil_env_t *env,
+            axis2_bool_t include_timestamp)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,include_timestamp,AXIS2_FAILURE);
+    
+    binding_commons->include_timestamp = include_timestamp;
+
+    return AXIS2_SUCCESS;
+    
+}
+
+AXIS2_EXTERN rp_algorithmsuite_t *AXIS2_CALL
+rp_binding_commons_get_algorithmsuite(
+    rp_binding_commons_t *binding_commons,
+    const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    
+    return binding_commons->algorithmsuite;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_binding_commons_set_algorithmsuite(rp_binding_commons_t *binding_commons,
+            const axutil_env_t *env,
+            rp_algorithmsuite_t *algorithmsuite)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,algorithmsuite,AXIS2_FAILURE);
+    
+    binding_commons->algorithmsuite = algorithmsuite;    
+    return AXIS2_SUCCESS;
+}
+
+
+AXIS2_EXTERN rp_layout_t *AXIS2_CALL
+rp_binding_commons_get_layout(
+    rp_binding_commons_t *binding_commons,
+    const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    
+    return binding_commons->layout;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_binding_commons_set_layout(rp_binding_commons_t *binding_commons,
+            const axutil_env_t *env,
+            rp_layout_t *layout)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,layout,AXIS2_FAILURE);
+    
+    binding_commons->layout = layout;    
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN rp_supporting_tokens_t *AXIS2_CALL
+rp_binding_commons_get_signed_supporting_tokens(
+    rp_binding_commons_t *binding_commons,
+    const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    
+    return binding_commons->signed_supporting_tokens;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_binding_commons_set_signed_supporting_tokens(
+            rp_binding_commons_t *binding_commons,
+            const axutil_env_t *env,
+            rp_supporting_tokens_t *signed_supporting_tokens)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,signed_supporting_tokens,AXIS2_FAILURE);
+ 
+    binding_commons->signed_supporting_tokens = signed_supporting_tokens;
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN rp_supporting_tokens_t *AXIS2_CALL
+rp_binding_commons_get_signed_endorsing_supporting_tokens(
+    rp_binding_commons_t *binding_commons,
+    const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, NULL);
+
+    return binding_commons->signed_endorsing_supporting_tokens;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_binding_commons_set_signed_endorsing_supporting_tokens(
+            rp_binding_commons_t *binding_commons,
+            const axutil_env_t *env,
+            rp_supporting_tokens_t *signed_endorsing_supporting_tokens)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,signed_endorsing_supporting_tokens,AXIS2_FAILURE);
+
+    binding_commons->signed_endorsing_supporting_tokens = signed_endorsing_supporting_tokens;
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN rp_supporting_tokens_t *AXIS2_CALL
+rp_binding_commons_get_endorsing_supporting_tokens(
+    rp_binding_commons_t *binding_commons,
+    const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    
+    return binding_commons->endorsing_supporting_tokens;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_binding_commons_set_endorsing_supporting_tokens(
+            rp_binding_commons_t *binding_commons,
+            const axutil_env_t *env,
+            rp_supporting_tokens_t *endorsing_supporting_tokens)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,endorsing_supporting_tokens,AXIS2_FAILURE);
+    binding_commons->endorsing_supporting_tokens = endorsing_supporting_tokens;
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN rp_supporting_tokens_t *AXIS2_CALL
+rp_binding_commons_get_supporting_tokens(
+    rp_binding_commons_t *binding_commons,
+    const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    
+    return binding_commons->supporting_tokens;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_binding_commons_set_supporting_tokens(
+            rp_binding_commons_t *binding_commons,
+            const axutil_env_t *env,
+            rp_supporting_tokens_t *supporting_tokens)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,supporting_tokens,AXIS2_FAILURE);
+        
+    binding_commons->supporting_tokens = supporting_tokens;
+    return AXIS2_SUCCESS;
+}

Added: webservices/axis2/scratch/c/neethi/src/secpolicy/model/element.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/src/secpolicy/model/element.c?view=auto&rev=529911
==============================================================================
--- webservices/axis2/scratch/c/neethi/src/secpolicy/model/element.c (added)
+++ webservices/axis2/scratch/c/neethi/src/secpolicy/model/element.c Wed Apr 18 01:14:56 2007
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <rp_element.h>
+
+struct rp_element_t
+{
+    axis2_char_t *name;
+    axis2_char_t *namespace;
+};
+
+AXIS2_EXTERN rp_element_t *AXIS2_CALL 
+rp_element_create(const axutil_env_t *env)
+{
+    rp_element_t *element = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+
+    element =  (rp_element_t *) AXIS2_MALLOC (env->allocator,
+    sizeof (rp_element_t));
+
+    if(element == NULL)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    element->name = NULL;
+    element->namespace = NULL;
+    
+    return element;
+
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_element_free(rp_element_t *element,
+        const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    if(element)
+    {
+        AXIS2_FREE(env->allocator, element);
+        element = NULL;
+    }
+    return AXIS2_SUCCESS;
+}
+
+
+/* Implementations */
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL 
+rp_element_get_name(rp_element_t *element,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+   
+    return element->name;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_element_set_name(rp_element_t *element,
+            const axutil_env_t *env,
+            axis2_char_t *name)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,name,AXIS2_FAILURE);   
+    
+    element->name = name;
+    return AXIS2_SUCCESS;
+}
+
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL 
+rp_element_get_namespace(rp_element_t *element,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    return element->namespace;
+    
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_element_set_namespace(rp_element_t *element,
+            const axutil_env_t *env,
+            axis2_char_t *namespace)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,namespace,AXIS2_FAILURE);   
+
+    element->namespace = namespace;
+
+    return AXIS2_SUCCESS;
+
+}
+
+

Added: webservices/axis2/scratch/c/neethi/src/secpolicy/model/header.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/src/secpolicy/model/header.c?view=auto&rev=529911
==============================================================================
--- webservices/axis2/scratch/c/neethi/src/secpolicy/model/header.c (added)
+++ webservices/axis2/scratch/c/neethi/src/secpolicy/model/header.c Wed Apr 18 01:14:56 2007
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <rp_header.h>
+
+struct rp_header_t
+{
+    axis2_char_t *name;
+    axis2_char_t *namespace;
+};
+
+AXIS2_EXTERN rp_header_t *AXIS2_CALL 
+rp_header_create(const axutil_env_t *env)
+{
+    rp_header_t *header = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+
+    header =  (rp_header_t *) AXIS2_MALLOC (env->allocator,
+    sizeof (rp_header_t));
+
+    if(header == NULL)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    header->name = NULL;
+    header->namespace = NULL;
+    
+    return header;
+
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_header_free(rp_header_t *header,
+        const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    if(header)
+    {
+        AXIS2_FREE(env->allocator, header);
+        header = NULL;
+    }
+    return AXIS2_SUCCESS;
+}
+
+
+/* Implementations */
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL 
+rp_header_get_name(rp_header_t *header,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+   
+    return header->name;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_header_set_name(rp_header_t *header,
+            const axutil_env_t *env,
+            axis2_char_t *name)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,name,AXIS2_FAILURE);   
+    
+    header->name = name;
+    return AXIS2_SUCCESS;
+}
+
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL 
+rp_header_get_namespace(rp_header_t *header,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    return header->namespace;
+    
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_header_set_namespace(rp_header_t *header,
+            const axutil_env_t *env,
+            axis2_char_t *namespace)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,namespace,AXIS2_FAILURE);   
+
+    header->namespace = namespace;
+
+    return AXIS2_SUCCESS;
+
+}
+
+

Added: webservices/axis2/scratch/c/neethi/src/secpolicy/model/https_token.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/src/secpolicy/model/https_token.c?view=auto&rev=529911
==============================================================================
--- webservices/axis2/scratch/c/neethi/src/secpolicy/model/https_token.c (added)
+++ webservices/axis2/scratch/c/neethi/src/secpolicy/model/https_token.c Wed Apr 18 01:14:56 2007
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <rp_https_token.h>
+
+struct rp_https_token_t
+{
+    axis2_char_t *inclusion;
+    axis2_bool_t derivedkeys;
+    axis2_bool_t require_client_certificate;
+};
+
+AXIS2_EXTERN rp_https_token_t *AXIS2_CALL 
+rp_https_token_create(const axutil_env_t *env)
+{
+    rp_https_token_t *https_token = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+
+    https_token =  (rp_https_token_t *) AXIS2_MALLOC (env->allocator,
+    sizeof (rp_https_token_t));
+
+    if(https_token == NULL)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    https_token->inclusion = RP_INCLUDE_ALWAYS;
+    https_token->derivedkeys = AXIS2_FALSE;
+    https_token->require_client_certificate = AXIS2_FALSE;
+  
+    return https_token;
+
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_https_token_free(rp_https_token_t *https_token,
+        const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    if(https_token)
+    {
+        AXIS2_FREE(env->allocator, https_token);
+        https_token = NULL;
+    }
+    return AXIS2_SUCCESS;
+}
+
+
+/* Implementations */
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL 
+rp_https_token_get_inclusion(rp_https_token_t *https_token,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    return https_token->inclusion;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_https_token_set_inclusion(rp_https_token_t *https_token,
+            const axutil_env_t *env,
+            axis2_char_t *inclusion)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,inclusion,AXIS2_FAILURE);
+    
+    https_token->inclusion = inclusion;
+
+    return AXIS2_SUCCESS;
+}
+
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL 
+rp_https_token_get_derivedkeys(rp_https_token_t *https_token,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FALSE);
+    
+    return https_token->derivedkeys;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_https_token_set_derivedkeys(rp_https_token_t *https_token,
+            const axutil_env_t *env,
+            axis2_bool_t derivedkeys)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,derivedkeys,AXIS2_FAILURE);
+    
+    https_token->derivedkeys = derivedkeys;
+
+    return AXIS2_SUCCESS;
+    
+}
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL 
+rp_https_token_get_require_client_certificate(rp_https_token_t *https_token,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    return https_token->require_client_certificate;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_https_token_set_require_client_certificate(rp_https_token_t *https_token,
+            const axutil_env_t *env,
+            axis2_bool_t require_client_certificate)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,require_client_certificate,AXIS2_FAILURE)    
+    https_token->require_client_certificate = require_client_certificate;
+
+    return AXIS2_SUCCESS;
+}

Added: webservices/axis2/scratch/c/neethi/src/secpolicy/model/layout.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/src/secpolicy/model/layout.c?view=auto&rev=529911
==============================================================================
--- webservices/axis2/scratch/c/neethi/src/secpolicy/model/layout.c (added)
+++ webservices/axis2/scratch/c/neethi/src/secpolicy/model/layout.c Wed Apr 18 01:14:56 2007
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <rp_layout.h>
+
+struct rp_layout_t
+{
+    axis2_char_t *value;
+};
+
+AXIS2_EXTERN rp_layout_t *AXIS2_CALL 
+rp_layout_create(const axutil_env_t *env)
+{
+    rp_layout_t *layout = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+
+    layout =  (rp_layout_t *) AXIS2_MALLOC (env->allocator,
+    sizeof (rp_layout_t));
+
+    if(layout == NULL)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    layout->value = RP_LAYOUT_STRICT;
+    return layout;
+
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_layout_free(rp_layout_t *layout,
+        const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    if(layout)
+    {
+        AXIS2_FREE(env->allocator, layout);
+        layout = NULL;
+    }
+    return AXIS2_SUCCESS;
+}
+
+
+/* Implementations */
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL 
+rp_layout_get_value(rp_layout_t *layout,
+            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+        
+    return layout->value;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_layout_set_value(rp_layout_t *layout,
+            const axutil_env_t *env,
+            axis2_char_t *value)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,value,AXIS2_FAILURE);    
+    
+    layout->value = value;
+    return AXIS2_SUCCESS;
+}
+

Added: webservices/axis2/scratch/c/neethi/src/secpolicy/model/property.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/src/secpolicy/model/property.c?view=auto&rev=529911
==============================================================================
--- webservices/axis2/scratch/c/neethi/src/secpolicy/model/property.c (added)
+++ webservices/axis2/scratch/c/neethi/src/secpolicy/model/property.c Wed Apr 18 01:14:56 2007
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <rp_property.h>
+#include <rp_symmetric_binding.h>
+#include <rp_asymmetric_binding.h>
+#include <rp_transport_binding.h>
+#include <rp_supporting_tokens.h>
+#include <rp_wss10.h>
+#include <rp_wss11.h>
+
+
+struct rp_property_t
+{
+    int type;
+    void *value;
+};
+
+
+AXIS2_EXTERN rp_property_t *AXIS2_CALL 
+rp_property_create(const axutil_env_t *env)
+{
+    rp_property_t *property = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+
+    property =  (rp_property_t *) AXIS2_MALLOC (env->allocator,
+    sizeof (rp_property_t));
+
+    if(property == NULL)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    property->type = 0;
+    property->value = NULL;
+
+    return property;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_property_free(
+    rp_property_t *property,
+    const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    if(property)
+    {
+        if(property->value)
+        {
+            switch(property->type)
+            {                
+                case RP_TOKEN_USERNAME:
+                    rp_username_token_free((rp_username_token_t *)property->value,env);
+                    property->value = NULL;
+                    break;
+
+                case RP_TOKEN_X509:
+                    rp_x509_token_free((rp_x509_token_t *)property->value,env);
+                    property->value = NULL;
+                    break;
+
+                case RP_TOKEN_SECURITY_CONTEXT:
+                    rp_security_context_token_free((rp_security_context_token_t *)property->value,env);
+                    property->value = NULL;
+                    break;
+
+                case RP_TOKEN_HTTPS:
+                    rp_https_token_free((rp_https_token_t *)property->value,env);
+                    property->value = NULL; 
+                    break;                                        
+                
+                case RP_BINDING_SYMMETRIC:
+                    rp_symmetric_binding_free((rp_symmetric_binding_t *)property->value,env);
+                    property->value = NULL;
+                    break;
+            
+                case RP_BINDING_ASYMMETRIC:
+                    rp_asymmetric_binding_free((rp_asymmetric_binding_t *)property->value,env);
+                    property->value = NULL;    
+                    break;
+                    
+                case RP_BINDING_TRANSPORT:
+                    rp_transport_binding_free((rp_transport_binding_t *)property->value,env);   
+                    property->value = NULL;
+                    break;
+
+                case RP_SUPPORTING_SIGNED_SUPPORTING:
+                    rp_supporting_tokens_free((rp_supporting_tokens_t *)property->value,env);
+                    property->value = NULL;
+                    break;
+
+                case RP_SUPPORTING_SIGNED_ENDORSING_SUPPORTING:
+                    rp_supporting_tokens_free((rp_supporting_tokens_t *)property->value,env);
+                    property->value = NULL;
+                    break;
+
+                case RP_WSS_WSS10:
+                    rp_wss10_free((rp_wss10_t *)property->value,env);
+                    property->value = NULL;
+                    break;
+
+                case RP_WSS_WSS11:
+                    rp_wss11_free((rp_wss11_t *)property->value,env);
+                    property->value = NULL;
+                    break;
+            }
+        }            
+        AXIS2_FREE(env->allocator,property);           
+    }
+
+    return AXIS2_SUCCESS;
+}
+
+
+/* Implementations */
+AXIS2_EXTERN void *AXIS2_CALL
+rp_property_get_value(
+    rp_property_t *property,
+    const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    return property->value;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_property_set_value(rp_property_t *property,
+    const axutil_env_t *env,
+    void *value,
+    int type)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,value,AXIS2_FAILURE);
+
+    property->type = type;
+    property->value =(void *)value; 
+
+    return AXIS2_SUCCESS;
+    
+}
+
+AXIS2_EXTERN int AXIS2_CALL 
+rp_property_get_type(
+    rp_property_t *property,
+    const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+        
+    return property->type;
+}

Added: webservices/axis2/scratch/c/neethi/src/secpolicy/model/rampart_config.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/src/secpolicy/model/rampart_config.c?view=auto&rev=529911
==============================================================================
--- webservices/axis2/scratch/c/neethi/src/secpolicy/model/rampart_config.c (added)
+++ webservices/axis2/scratch/c/neethi/src/secpolicy/model/rampart_config.c Wed Apr 18 01:14:56 2007
@@ -0,0 +1,277 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <rp_rampart_config.h>
+
+struct rp_rampart_config_t
+{
+    axis2_char_t *user;
+    axis2_char_t *encryption_user;
+    axis2_char_t *password_callback_class;
+    axis2_char_t *authenticate_module;
+    axis2_char_t *password_type;
+    axis2_char_t *time_to_live;
+    axis2_char_t *receiver_certificate_file;
+    axis2_char_t *certificate_file;
+    axis2_char_t *private_key_file;
+};
+
+AXIS2_EXTERN rp_rampart_config_t *AXIS2_CALL 
+rp_rampart_config_create(const axutil_env_t *env)
+{
+    rp_rampart_config_t *rampart_config = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+
+    rampart_config =  (rp_rampart_config_t *) AXIS2_MALLOC (env->allocator,
+    sizeof (rp_rampart_config_t));
+
+    if(rampart_config == NULL)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    rampart_config->user = NULL;
+    rampart_config->encryption_user = NULL;
+    rampart_config->password_callback_class = NULL;
+    rampart_config->private_key_file = NULL;
+    rampart_config->receiver_certificate_file = NULL;
+    rampart_config->certificate_file = NULL;
+    rampart_config->authenticate_module = NULL;
+    rampart_config->password_type = NULL;
+    rampart_config->time_to_live = NULL;
+    return rampart_config;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_rampart_config_free(rp_rampart_config_t *rampart_config,
+        const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+    if(rampart_config)
+    {
+        AXIS2_FREE(env->allocator,rampart_config);
+        rampart_config = NULL;
+    }
+    return AXIS2_SUCCESS;
+}
+
+
+/* Implementations */
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_rampart_config_get_user(
+    rp_rampart_config_t *rampart_config,
+    const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    return rampart_config->user;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_rampart_config_set_user(rp_rampart_config_t *rampart_config,
+            const axutil_env_t *env,
+            axis2_char_t *user)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,user,AXIS2_FAILURE);
+
+    rampart_config->user = user;
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_rampart_config_get_encryption_user(
+    rp_rampart_config_t *rampart_config,
+    const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+    return rampart_config->encryption_user;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_rampart_config_set_encryption_user(rp_rampart_config_t *rampart_config,
+            const axutil_env_t *env,
+            axis2_char_t *encryption_user)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,encryption_user,AXIS2_FAILURE);
+        
+    rampart_config->encryption_user = encryption_user;
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_rampart_config_get_password_callback_class(
+    rp_rampart_config_t *rampart_config,
+    const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+    return rampart_config->password_callback_class;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_rampart_config_set_password_callback_class(rp_rampart_config_t *rampart_config,
+            const axutil_env_t *env,
+            axis2_char_t *password_callback_class)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,password_callback_class,AXIS2_FAILURE);   
+        
+    rampart_config->password_callback_class = password_callback_class;
+    return AXIS2_SUCCESS;
+}
+
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_rampart_config_get_authenticate_module(
+    rp_rampart_config_t *rampart_config,
+    const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+    return rampart_config->authenticate_module;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_rampart_config_set_authenticate_module(rp_rampart_config_t *rampart_config,
+            const axutil_env_t *env,
+            axis2_char_t *authenticate_module)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,authenticate_module,AXIS2_FAILURE);   
+        
+    rampart_config->authenticate_module = authenticate_module;
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_rampart_config_get_password_type(
+    rp_rampart_config_t *rampart_config,
+    const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+    return rampart_config->password_type;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_rampart_config_set_password_type(rp_rampart_config_t *rampart_config,
+            const axutil_env_t *env,
+            axis2_char_t *password_type)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,password_type,AXIS2_FAILURE);   
+        
+    rampart_config->password_type = password_type;
+    return AXIS2_SUCCESS;
+}
+
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_rampart_config_get_private_key_file(
+    rp_rampart_config_t *rampart_config,
+    const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+    return rampart_config->private_key_file;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_rampart_config_set_private_key_file(rp_rampart_config_t *rampart_config,
+            const axutil_env_t *env,
+            axis2_char_t *private_key_file)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,private_key_file,AXIS2_FAILURE);
+        
+    rampart_config->private_key_file = private_key_file;
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_rampart_config_get_receiver_certificate_file(
+    rp_rampart_config_t *rampart_config,
+    const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+    return rampart_config->receiver_certificate_file;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_rampart_config_set_receiver_certificate_file(rp_rampart_config_t *rampart_config,
+            const axutil_env_t *env,
+            axis2_char_t *receiver_certificate_file)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,receiver_certificate_file,AXIS2_FAILURE);   
+        
+    rampart_config->receiver_certificate_file = receiver_certificate_file;
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_rampart_config_get_certificate_file(
+    rp_rampart_config_t *rampart_config,
+    const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+    return rampart_config->certificate_file;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_rampart_config_set_certificate_file(rp_rampart_config_t *rampart_config,
+            const axutil_env_t *env,
+            axis2_char_t *certificate_file)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,certificate_file,AXIS2_FAILURE);   
+        
+    rampart_config->certificate_file = certificate_file;
+    return AXIS2_SUCCESS;
+}
+
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_rampart_config_get_time_to_live(
+    rp_rampart_config_t *rampart_config,
+    const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+    return rampart_config->time_to_live;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_rampart_config_set_time_to_live(rp_rampart_config_t *rampart_config,
+            const axutil_env_t *env,
+            axis2_char_t *time_to_live)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error,time_to_live,AXIS2_FAILURE);   
+        
+    rampart_config->time_to_live = time_to_live;
+    return AXIS2_SUCCESS;
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message