axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kausha...@apache.org
Subject svn commit: r498596 [4/7] - in /webservices/axis2/trunk/c/rampart: ./ include/ src/ src/secpolicy/ src/secpolicy/builder/ src/secpolicy/model/ src/secpolicy/test-resources/
Date Mon, 22 Jan 2007 12:38:03 GMT
Added: webservices/axis2/trunk/c/rampart/src/secpolicy/builder/supporting_tokens_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/builder/supporting_tokens_builder.c?view=auto&rev=498596
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/secpolicy/builder/supporting_tokens_builder.c (added)
+++ webservices/axis2/trunk/c/rampart/src/secpolicy/builder/supporting_tokens_builder.c Mon Jan 22 04:37:57 2007
@@ -0,0 +1,223 @@
+/*
+ * 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_supporting_tokens_builder.h>
+
+AXIS2_EXTERN rp_supporting_tokens_t *AXIS2_CALL 
+rp_supporting_tokens_builder_build(const axis2_env_t *env, axiom_node_t *supporting)
+  
+{
+    rp_supporting_tokens_t *supporting_tokens = NULL;
+    axiom_element_t *pol_ele = NULL;
+    axiom_node_t *policy = NULL;
+    rp_property_t *property = NULL;
+    axis2_status_t status = AXIS2_SUCCESS;
+
+    AXIS2_ENV_CHECK(env, NULL);
+
+    if(supporting)
+    {
+        policy = AXIOM_NODE_GET_FIRST_CHILD(supporting,env);
+
+        if(AXIOM_NODE_GET_NODE_TYPE(policy, env) == AXIOM_ELEMENT)
+        {
+            pol_ele = (axiom_element_t*)AXIOM_NODE_GET_DATA_ELEMENT(policy, env);
+
+            supporting_tokens = rp_supporting_tokens_create(env);
+            if(!supporting_tokens)
+                return NULL;
+
+            if(pol_ele)
+            {
+                axiom_children_iterator_t *children_iter = NULL;
+                children_iter = AXIOM_ELEMENT_GET_CHILDREN(pol_ele, env, policy);
+                if(children_iter )
+                {
+                    while(AXIOM_CHILDREN_ITERATOR_HAS_NEXT(children_iter, env))
+                    {
+                        axiom_node_t *node = NULL;
+                        axiom_element_t *ele = NULL;
+                        axis2_char_t *local_name = NULL;
+                        node = AXIOM_CHILDREN_ITERATOR_NEXT(children_iter, env);
+                        if(node)
+                        {
+                            if(AXIOM_NODE_GET_NODE_TYPE(node, env) == AXIOM_ELEMENT)
+                            {
+                                ele = (axiom_element_t*)AXIOM_NODE_GET_DATA_ELEMENT(node, env);
+                                if(ele)
+                                {
+                                    local_name = AXIOM_ELEMENT_GET_LOCALNAME(ele,env);
+                                    if(local_name)
+                                    {
+                                        if(rp_supporting_tokens_builder_istoken(env,local_name))
+                                        {
+                                            property = rp_property_create(env);
+                                            if(!property)
+                                                return NULL;
+                                            status = rp_token_builder_set_token(node,ele,local_name,property,env);
+                                            if(status!=AXIS2_SUCCESS)
+                                            {
+                                                rp_property_free(property,env);
+                                                property = NULL;
+                                                return NULL; 
+                                            }
+                                            status = rp_supporting_tokens_add_token(supporting_tokens,env,property);  
+                                            if(status!=AXIS2_SUCCESS)
+                                            {
+                                                rp_property_free(property,env);
+                                                property = NULL;
+                                                return NULL;
+                                            }
+                                        }
+                                        else
+                                        {
+                                            status = rp_supporting_tokens_builder_set_other_properties(env,supporting_tokens,node,ele,local_name);
+                                            if(status!=AXIS2_SUCCESS)
+                                                return NULL;
+                                        }
+                                            
+                                    }
+                                    
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+    return supporting_tokens;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_supporting_tokens_builder_set_other_properties(
+            const axis2_env_t *env,
+            rp_supporting_tokens_t *supporting_tokens,
+            axiom_node_t *node,
+            axiom_element_t *element,
+            axis2_char_t *local_name)    
+{
+    AXIS2_ENV_CHECK(env,AXIS2_FAILURE);
+    
+    if(AXIS2_STRCMP(local_name,RP_ALGORITHM_SUITE)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_ALGORITHM_SUITE,node,element))
+        {
+            rp_algorithmsuite_t *algorithmsuite = NULL;
+            algorithmsuite = rp_algorithmsuite_builder_build(env,node);
+            if(!algorithmsuite)
+                return AXIS2_FAILURE;
+
+            printf("%s\n",local_name);
+            return rp_supporting_tokens_set_algorithmsuite(supporting_tokens,env,algorithmsuite);
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else if(AXIS2_STRCMP(local_name,RP_SIGNED_PARTS)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_SIGNED_PARTS,node,element))
+        {
+            rp_signed_encrypted_parts_t *signed_parts = NULL;
+            signed_parts = rp_signed_encrypted_parts_builder_build(env,node);
+            if(!signed_parts)
+                return AXIS2_FAILURE;
+            
+            rp_signed_encrypted_parts_set_signedparts(signed_parts,env,AXIS2_TRUE);
+
+            printf("%s\n",local_name);
+            return rp_supporting_tokens_set_signed_parts(supporting_tokens,env,signed_parts);
+        }
+        else
+            return AXIS2_FAILURE;
+    }    
+    else if(AXIS2_STRCMP(local_name,RP_SIGNED_ELEMENTS)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_SIGNED_ELEMENTS,node,element))
+        {
+            rp_signed_encrypted_elements_t *signed_elements = NULL;
+            signed_elements = rp_signed_encrypted_elements_builder_build(env,node);
+            if(!signed_elements)
+                return AXIS2_FAILURE;
+            
+            rp_signed_encrypted_elements_set_signedelements(signed_elements,env,AXIS2_TRUE);
+
+            printf("%s\n",local_name);
+            return rp_supporting_tokens_set_signed_elements(supporting_tokens,env,signed_elements);
+        }
+        else
+            return AXIS2_FAILURE;
+
+    }
+    else if(AXIS2_STRCMP(local_name,RP_ENCRYPTED_PARTS)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_ENCRYPTED_PARTS,node,element))
+        {
+            rp_signed_encrypted_parts_t *encrypted_parts = NULL;
+            encrypted_parts = rp_signed_encrypted_parts_builder_build(env,node);
+            if(!encrypted_parts)
+                return AXIS2_FAILURE;
+
+            rp_signed_encrypted_parts_set_signedparts(encrypted_parts,env,AXIS2_FALSE);
+
+            printf("%s\n",local_name);
+            return rp_supporting_tokens_set_encrypted_parts(supporting_tokens,env,encrypted_parts);
+        }
+        else
+            return AXIS2_FAILURE;
+            
+    }
+    else if(AXIS2_STRCMP(local_name,RP_ENCRYPTED_ELEMENTS)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_ENCRYPTED_ELEMENTS,node,element))
+        {
+            rp_signed_encrypted_elements_t *encrypted_elements = NULL;
+            encrypted_elements = rp_signed_encrypted_elements_builder_build(env,node);
+            if(!encrypted_elements)
+                return AXIS2_FAILURE;
+
+            rp_signed_encrypted_elements_set_signedelements(encrypted_elements,env,AXIS2_FALSE);
+
+            printf("%s\n",local_name);
+            return rp_supporting_tokens_set_encrypted_elements(supporting_tokens,env,encrypted_elements);
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else return AXIS2_FAILURE;
+}
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_supporting_tokens_builder_istoken(
+        const axis2_env_t *env,
+        axis2_char_t *local_name)
+{
+    AXIS2_ENV_CHECK(env,AXIS2_FALSE);
+
+    if(AXIS2_STRCMP(local_name,RP_USERNAME_TOKEN)==0)
+        return AXIS2_TRUE;
+    
+    else if(AXIS2_STRCMP(local_name,RP_X509_TOKEN)==0)
+        return AXIS2_TRUE;
+
+    else if(AXIS2_STRCMP(local_name,RP_SECURITY_CONTEXT_TOKEN)==0)
+        return AXIS2_TRUE;
+
+    else
+        return AXIS2_FALSE;
+}

Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/builder/supporting_tokens_builder.c
------------------------------------------------------------------------------
    svn:executable = *

Added: webservices/axis2/trunk/c/rampart/src/secpolicy/builder/symmetric_asymmetric_commons_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/builder/symmetric_asymmetric_commons_builder.c?view=auto&rev=498596
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/secpolicy/builder/symmetric_asymmetric_commons_builder.c (added)
+++ webservices/axis2/trunk/c/rampart/src/secpolicy/builder/symmetric_asymmetric_commons_builder.c Mon Jan 22 04:37:57 2007
@@ -0,0 +1,79 @@
+/*
+ * 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_symmetric_asymmetric_commons_builder.h>
+#include <rp_qname_matcher.h>
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_symmetric_asymmetric_commons_builder_build(
+            const axis2_env_t *env,
+            axiom_node_t *node,
+            axiom_element_t *element,
+            axis2_char_t *local_name,    
+            rp_symmetric_asymmetric_binding_commons_t *as_commons,
+            rp_binding_commons_t *commons)
+{
+    AXIS2_ENV_CHECK(env,AXIS2_FAILURE);
+
+    if(AXIS2_STRCMP(local_name,RP_ENCRYPT_BEFORE_SIGNING)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_ENCRYPT_BEFORE_SIGNING,node,element))
+        {            
+            rp_symmetric_asymmetric_binding_commons_set_protection_order(as_commons,env,local_name);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        return AXIS2_FAILURE;
+    }        
+    
+    else if(AXIS2_STRCMP(local_name,RP_ENCRYPT_SIGNATURE)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_ENCRYPT_SIGNATURE,node,element))
+        {
+            rp_symmetric_asymmetric_binding_commons_set_signature_protection(as_commons,env,AXIS2_TRUE);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        return AXIS2_FAILURE;
+    }
+    
+    else if(AXIS2_STRCMP(local_name,RP_PROTECT_TOKENS)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_PROTECT_TOKENS,node,element))
+        {
+            rp_symmetric_asymmetric_binding_commons_set_token_protection(as_commons,env,AXIS2_TRUE);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        return AXIS2_FAILURE;
+    }
+
+    else if(AXIS2_STRCMP(local_name,RP_ONLY_SIGN_ENTIRE_HEADERS_AND_BODY)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_ONLY_SIGN_ENTIRE_HEADERS_AND_BODY,node,element))
+        {
+            rp_symmetric_asymmetric_binding_commons_set_entire_headers_and_body_signatures(as_commons,env,AXIS2_TRUE);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        return AXIS2_FAILURE;
+    }
+    else  
+        return rp_binding_commons_builder_build(env,node,element,local_name,commons);
+}
+

Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/builder/symmetric_asymmetric_commons_builder.c
------------------------------------------------------------------------------
    svn:executable = *

Added: webservices/axis2/trunk/c/rampart/src/secpolicy/builder/symmetric_binding_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/builder/symmetric_binding_builder.c?view=auto&rev=498596
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/secpolicy/builder/symmetric_binding_builder.c (added)
+++ webservices/axis2/trunk/c/rampart/src/secpolicy/builder/symmetric_binding_builder.c Mon Jan 22 04:37:57 2007
@@ -0,0 +1,173 @@
+/*
+ * 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_symmetric_binding_builder.h>
+#include <rp_qname_matcher.h>
+#include <rp_token_builder.h>
+
+AXIS2_EXTERN rp_symmetric_binding_t *AXIS2_CALL 
+rp_symmetric_binding_builder_build(const axis2_env_t *env, axiom_node_t *symmetric)
+  
+{
+    rp_symmetric_binding_t *symmetric_binding = NULL;
+    rp_symmetric_asymmetric_binding_commons_t *as_commons = NULL;
+    rp_binding_commons_t *commons = NULL;        
+    axiom_element_t *pol_ele = NULL;
+    axiom_node_t *policy = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+
+    if(symmetric)
+    {
+        policy = AXIOM_NODE_GET_FIRST_CHILD(symmetric,env);
+
+        if(AXIOM_NODE_GET_NODE_TYPE(policy, env) == AXIOM_ELEMENT)
+        {
+            pol_ele = (axiom_element_t*)AXIOM_NODE_GET_DATA_ELEMENT(policy, env);
+
+            symmetric_binding = rp_symmetric_binding_create(env);
+            if(!symmetric_binding)
+                return NULL;
+
+            as_commons = rp_symmetric_asymmetric_binding_commons_create(env);
+            if(!as_commons)
+                return NULL;
+
+            commons = rp_binding_commons_create(env);
+            if(!commons)
+                return NULL;
+                        
+            if(pol_ele)
+            {
+                axiom_children_iterator_t *children_iter = NULL;
+                children_iter = AXIOM_ELEMENT_GET_CHILDREN(pol_ele, env, policy);
+                if(children_iter )
+                {
+                    while(AXIOM_CHILDREN_ITERATOR_HAS_NEXT(children_iter, env))
+                    {
+                        axiom_node_t *node = NULL;
+                        axiom_element_t *ele = NULL;
+                        axis2_char_t *local_name = NULL;
+                        node = AXIOM_CHILDREN_ITERATOR_NEXT(children_iter, env);
+                        if(node)
+                        {
+                            if(AXIOM_NODE_GET_NODE_TYPE(node, env) == AXIOM_ELEMENT)
+                            {
+                                ele = (axiom_element_t*)AXIOM_NODE_GET_DATA_ELEMENT(node, env);
+                                if(ele)
+                                {
+                                    local_name = AXIOM_ELEMENT_GET_LOCALNAME(ele,env);
+                                    if(local_name)
+                                    {
+                                        if(rp_symmetric_binding_builder_istoken(env,local_name))
+                                            rp_symmetric_binding_builder_set_token_type(env,symmetric_binding,node,ele,local_name); 
+                                        else
+                                            rp_symmetric_asymmetric_commons_builder_build(env,node,ele,local_name,as_commons,commons);                                                         
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+                rp_symmetric_asymmetric_binding_commons_set_binding_commons(as_commons,env,commons);
+                rp_symmetric_binding_set_symmetric_asymmetric_binding_commons(symmetric_binding,env,as_commons);               
+            }
+        }
+    }
+    return symmetric_binding;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_symmetric_binding_builder_set_token_type(
+            const axis2_env_t *env,
+            rp_symmetric_binding_t *symmetric_binding,
+            axiom_node_t *node,
+            axiom_element_t *element,
+            axis2_char_t *local_name)    
+{
+    AXIS2_ENV_CHECK(env,AXIS2_FAILURE);
+    
+    if(AXIS2_STRCMP(local_name,RP_PROTECTION_TOKEN)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_PROTECTION_TOKEN,node,element))
+        {
+            rp_property_t *protection_token = NULL;
+            protection_token = rp_token_builder_build(env,node);
+            if(!protection_token)
+                return AXIS2_FAILURE;
+
+            printf("%s\n",local_name);
+            return rp_symmetric_binding_set_protection_token(symmetric_binding,env,protection_token);
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else if(AXIS2_STRCMP(local_name,RP_ENCRYPTION_TOKEN)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_ENCRYPTION_TOKEN,node,element))
+        {
+            rp_property_t *encryption_token = NULL;
+            encryption_token = rp_token_builder_build(env,node);
+            if(!encryption_token)
+                return AXIS2_FAILURE;
+
+            printf("%s\n",local_name);
+            return rp_symmetric_binding_set_encryption_token(symmetric_binding,env,encryption_token);
+        }
+        else
+            return AXIS2_FAILURE;
+        
+    }
+    else if(AXIS2_STRCMP(local_name,RP_SIGNATURE_TOKEN)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_SIGNATURE_TOKEN,node,element))
+        {
+            rp_property_t *signature_token = NULL;
+            signature_token = rp_token_builder_build(env,node);
+            if(!signature_token)
+                return AXIS2_FAILURE;
+
+            printf("%s\n",local_name);
+            return rp_symmetric_binding_set_signature_token(symmetric_binding,env,signature_token);
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else
+        return AXIS2_FAILURE;
+}
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_symmetric_binding_builder_istoken(
+        const axis2_env_t *env,
+        axis2_char_t *local_name)
+{
+    AXIS2_ENV_CHECK(env,AXIS2_FALSE);
+
+    if(AXIS2_STRCMP(local_name,RP_PROTECTION_TOKEN)==0)
+        return AXIS2_TRUE;
+    
+    else if(AXIS2_STRCMP(local_name,RP_ENCRYPTION_TOKEN)==0)
+        return AXIS2_TRUE;
+
+    else if(AXIS2_STRCMP(local_name,RP_SIGNATURE_TOKEN)==0)
+        return AXIS2_TRUE;
+
+    else
+        return AXIS2_FALSE;
+}

Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/builder/symmetric_binding_builder.c
------------------------------------------------------------------------------
    svn:executable = *

Added: webservices/axis2/trunk/c/rampart/src/secpolicy/builder/token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/builder/token_builder.c?view=auto&rev=498596
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/secpolicy/builder/token_builder.c (added)
+++ webservices/axis2/trunk/c/rampart/src/secpolicy/builder/token_builder.c Mon Jan 22 04:37:57 2007
@@ -0,0 +1,143 @@
+/*
+ * 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_token_builder.h>
+
+AXIS2_EXTERN rp_property_t *AXIS2_CALL
+rp_token_builder_build(
+            const axis2_env_t *env,
+            axiom_node_t *token)
+{
+    rp_property_t *property = NULL;
+    axiom_node_t *policy = NULL;
+    axiom_node_t *token_name = NULL;
+    axiom_element_t *token_name_ele = NULL;
+    axis2_char_t *token_value = NULL;
+    axis2_status_t status = AXIS2_SUCCESS;
+
+    AXIS2_ENV_CHECK(env,NULL);
+
+    if(token)
+    {
+        property = rp_property_create(env);
+        if(!property)
+            return NULL;
+        policy = AXIOM_NODE_GET_FIRST_CHILD(token,env);
+        if(policy)
+        {
+            token_name = AXIOM_NODE_GET_FIRST_CHILD(policy,env);
+            if(token_name)
+            {
+                if(AXIOM_NODE_GET_NODE_TYPE(token_name,env) == AXIOM_ELEMENT)
+                {
+                    token_name_ele = (axiom_element_t*)AXIOM_NODE_GET_DATA_ELEMENT(token_name, env);
+                    if(token_name_ele)
+                    {
+                        token_value = AXIOM_ELEMENT_GET_LOCALNAME(token_name_ele, env);
+                        if(token_value)
+                        {
+                            status = rp_token_builder_set_token(token_name,token_name_ele,token_value,property,env);
+                            if(status!=AXIS2_SUCCESS)
+                            {
+                                rp_property_free(property,env);
+                                property = NULL;
+                            }                                
+                        } 
+                    }
+                }
+            }
+        }
+    }
+    return property;
+}            
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_token_builder_set_token(
+        axiom_node_t *node,
+        axiom_element_t *element,
+        axis2_char_t *value,
+        rp_property_t *token,
+        const axis2_env_t *env)
+
+{
+    AXIS2_ENV_CHECK(env,AXIS2_FAILURE);
+    
+    if(AXIS2_STRCMP(value,RP_USERNAME_TOKEN)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_USERNAME_TOKEN,node,element))
+        {
+            rp_username_token_t *username_token = NULL;
+            username_token = rp_username_token_builder_build(env,node,element);
+            if(!username_token)
+                return AXIS2_FAILURE;
+
+            printf("%s\n",value);
+            return rp_property_set_value(token,env,username_token,RP_TOKEN_USERNAME);
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else if(AXIS2_STRCMP(value,RP_X509_TOKEN)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_X509_TOKEN,node,element))
+        {
+            rp_x509_token_t *x509_token = NULL;
+            x509_token = rp_x509_token_builder_build(env,node,element);
+            if(!x509_token)
+                return AXIS2_FAILURE;
+
+            printf("%s\n",value);
+            return rp_property_set_value(token,env,x509_token,RP_TOKEN_X509);
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else if(AXIS2_STRCMP(value,RP_SECURITY_CONTEXT_TOKEN)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_SECURITY_CONTEXT_TOKEN,node,element))
+        {
+            rp_security_context_token_t *security_context_token = NULL;
+            security_context_token = rp_security_context_token_builder_build(env,node,element);
+            if(!security_context_token)
+                return AXIS2_FAILURE;
+
+            printf("%s\n",value);
+            return rp_property_set_value(token,env,security_context_token,RP_TOKEN_SECURITY_CONTEXT);
+        }
+        else
+            return AXIS2_FAILURE;
+    }        
+    else if(AXIS2_STRCMP(value,RP_HTTPS_TOKEN)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_HTTPS_TOKEN,node,element))
+        {
+            rp_https_token_t *https_token = NULL;
+            https_token = rp_https_token_builder_build(env,node,element);
+            if(!https_token)
+                return AXIS2_FAILURE;
+
+            printf("%s\n",value);
+            return rp_property_set_value(token,env,https_token,RP_TOKEN_HTTPS);
+
+        }
+        else
+            return AXIS2_FAILURE;
+    }  
+    else
+        return AXIS2_FAILURE;
+}    

Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/builder/token_builder.c
------------------------------------------------------------------------------
    svn:executable = *

Added: webservices/axis2/trunk/c/rampart/src/secpolicy/builder/transport_binding_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/builder/transport_binding_builder.c?view=auto&rev=498596
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/secpolicy/builder/transport_binding_builder.c (added)
+++ webservices/axis2/trunk/c/rampart/src/secpolicy/builder/transport_binding_builder.c Mon Jan 22 04:37:57 2007
@@ -0,0 +1,129 @@
+/*
+ * 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_builder.h>
+#include <rp_transport_binding_builder.h>
+#include <rp_qname_matcher.h>
+#include <rp_token_builder.h>
+
+AXIS2_EXTERN rp_transport_binding_t *AXIS2_CALL 
+rp_transport_binding_builder_build(const axis2_env_t *env, axiom_node_t *transport)
+{
+    rp_transport_binding_t *transport_binding = NULL;
+    rp_binding_commons_t *commons = NULL;        
+    axiom_element_t *pol_ele = NULL;
+    axiom_node_t *policy = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+
+    if(transport)
+    {
+        policy = AXIOM_NODE_GET_FIRST_CHILD(transport,env);
+
+        if(AXIOM_NODE_GET_NODE_TYPE(policy, env) == AXIOM_ELEMENT)
+        {
+            pol_ele = (axiom_element_t*)AXIOM_NODE_GET_DATA_ELEMENT(policy, env);
+
+            transport_binding = rp_transport_binding_create(env);
+            if(!transport_binding)
+                return NULL;
+
+            commons = rp_binding_commons_create(env);
+            if(!commons)
+                return NULL;
+                        
+            if(pol_ele)
+            {
+                axiom_children_iterator_t *children_iter = NULL;
+                children_iter = AXIOM_ELEMENT_GET_CHILDREN(pol_ele, env, policy);
+                if(children_iter )
+                {
+                    while(AXIOM_CHILDREN_ITERATOR_HAS_NEXT(children_iter, env))
+                    {
+                        axiom_node_t *node = NULL;
+                        axiom_element_t *ele = NULL;
+                        axis2_char_t *local_name = NULL;
+                        node = AXIOM_CHILDREN_ITERATOR_NEXT(children_iter, env);
+                        if(node)
+                        {
+                            if(AXIOM_NODE_GET_NODE_TYPE(node, env) == AXIOM_ELEMENT)
+                            {
+                                ele = (axiom_element_t*)AXIOM_NODE_GET_DATA_ELEMENT(node, env);
+                                if(ele)
+                                {
+                                    local_name = AXIOM_ELEMENT_GET_LOCALNAME(ele,env);
+                                    if(local_name)
+                                    {
+                                        if(rp_transport_binding_builder_istoken(env,local_name))
+                                            rp_transport_binding_builder_set_token_type(env,transport_binding,node,ele,local_name); 
+                                        else
+                                            rp_binding_commons_builder_build(env,node,ele,local_name,commons);
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+                rp_transport_binding_set_binding_commons(transport_binding,env,commons);               
+            }
+        }
+    }
+    return transport_binding;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_transport_binding_builder_set_token_type(
+            const axis2_env_t *env,
+            rp_transport_binding_t *transport_binding,
+            axiom_node_t *node,
+            axiom_element_t *element,
+            axis2_char_t *local_name)    
+{
+    AXIS2_ENV_CHECK(env,AXIS2_FAILURE);
+    
+    if(AXIS2_STRCMP(local_name,RP_TRANSPORT_TOKEN)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_TRANSPORT_TOKEN,node,element))
+        {
+            rp_property_t *transport_token = NULL;
+            transport_token = rp_token_builder_build(env,node);
+            if(!transport_token)
+                return AXIS2_FAILURE;
+
+            printf("%s\n",local_name);
+            return rp_transport_binding_set_transport_token(transport_binding,env,transport_token);
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else
+        return AXIS2_FAILURE;
+}
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_transport_binding_builder_istoken(
+        const axis2_env_t *env,
+        axis2_char_t *local_name)
+{
+    AXIS2_ENV_CHECK(env,AXIS2_FALSE);
+
+    if(AXIS2_STRCMP(local_name,RP_TRANSPORT_TOKEN)==0)
+        return AXIS2_TRUE;
+    
+    else
+        return AXIS2_FALSE;
+}

Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/builder/transport_binding_builder.c
------------------------------------------------------------------------------
    svn:executable = *

Added: webservices/axis2/trunk/c/rampart/src/secpolicy/builder/username_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/builder/username_token_builder.c?view=auto&rev=498596
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/secpolicy/builder/username_token_builder.c (added)
+++ webservices/axis2/trunk/c/rampart/src/secpolicy/builder/username_token_builder.c Mon Jan 22 04:37:57 2007
@@ -0,0 +1,161 @@
+/*
+ * 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_username_token_builder.h>
+
+AXIS2_EXTERN rp_username_token_t *AXIS2_CALL
+rp_username_token_builder_build(
+            const axis2_env_t *env,
+            axiom_node_t *username,
+            axiom_element_t *username_ele)
+{
+    rp_username_token_t *username_token = NULL;
+    axiom_node_t *policy = NULL;
+    axiom_element_t *pol_ele = NULL;
+    axis2_status_t status = AXIS2_SUCCESS;
+
+    AXIS2_ENV_CHECK(env,NULL);
+
+    username_token = rp_username_token_create(env);
+    if(!username_token)
+        return NULL;
+
+    status = rp_username_token_builder_set_inclusion_value(env,username_token,username_ele);
+    if(status != AXIS2_SUCCESS )
+    {
+        rp_username_token_free(username_token,env);
+        username_token = NULL;
+        return NULL;
+    }
+    policy = AXIOM_NODE_GET_FIRST_CHILD(username,env);
+    if(!policy) 
+        return username_token;
+
+    if(AXIOM_NODE_GET_NODE_TYPE(policy, env) == AXIOM_ELEMENT)
+    {
+        pol_ele = (axiom_element_t*)AXIOM_NODE_GET_DATA_ELEMENT(policy, env);
+        if(pol_ele)
+        {
+            axiom_children_iterator_t *children_iter = NULL;
+            children_iter = AXIOM_ELEMENT_GET_CHILDREN(pol_ele, env, policy);
+            if(children_iter )
+            {
+                while(AXIOM_CHILDREN_ITERATOR_HAS_NEXT(children_iter, env))
+                {
+                    axiom_node_t *node = NULL;
+                    axiom_element_t *ele = NULL;
+                    axis2_char_t *local_name = NULL;
+                    node = AXIOM_CHILDREN_ITERATOR_NEXT(children_iter, env);
+                    if(node)
+                    {
+                        if(AXIOM_NODE_GET_NODE_TYPE(node, env) == AXIOM_ELEMENT)
+                        {
+                            ele = (axiom_element_t*)AXIOM_NODE_GET_DATA_ELEMENT(node, env);
+                            if(ele)
+                            {
+                                local_name = AXIOM_ELEMENT_GET_LOCALNAME(ele,env);
+                                if(local_name)
+                                {
+                                    status = rp_username_token_builder_set_properties(node,ele,local_name,username_token,env);
+                                    if(status != AXIS2_SUCCESS)
+                                    {
+                                        rp_username_token_free(username_token,env);
+                                        username_token = NULL;
+                                        break;
+                                    }
+                                }
+                            }
+                            
+                        }
+                    }
+                }
+            }
+        }
+    }
+    return username_token;
+}            
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_username_token_builder_set_inclusion_value(
+        const axis2_env_t *env,
+        rp_username_token_t *token,
+        axiom_element_t *element)
+{
+    axis2_char_t *inclusion_value = NULL;
+    axis2_qname_t *qname = NULL;
+
+	AXIS2_ENV_CHECK(env,AXIS2_FAILURE);
+
+    qname = axis2_qname_create(env,RP_INCLUDE_TOKEN,RP_SP_NS,RP_SP_PREFIX);
+    if(!qname)
+        return AXIS2_FAILURE;
+    
+    inclusion_value = AXIOM_ELEMENT_GET_ATTRIBUTE_VALUE(element,env,qname);
+            
+    AXIS2_QNAME_FREE(qname,env);
+    qname = NULL;         
+
+    return rp_username_token_set_inclusion(token,env,inclusion_value);    
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_username_token_builder_set_properties(
+        axiom_node_t *node,
+        axiom_element_t *element,
+        axis2_char_t *local_name,
+        rp_username_token_t *username_token,
+        const axis2_env_t *env)
+{
+    AXIS2_ENV_CHECK(env,AXIS2_FAILURE);
+
+    if(strcmp(local_name,RP_WSS_USERNAME_TOKEN_10)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_WSS_USERNAME_TOKEN_10,node,element))
+        {
+            rp_username_token_set_useUTprofile10(username_token,env,AXIS2_TRUE);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else if(strcmp(local_name,RP_WSS_USERNAME_TOKEN_11)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_WSS_USERNAME_TOKEN_11,node,element))
+        {
+            rp_username_token_set_useUTprofile11(username_token,env,AXIS2_TRUE);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else if(strcmp(local_name,RP_REQUIRE_DERIVED_KEYS)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_REQUIRE_DERIVED_KEYS,node,element))
+        {
+            rp_username_token_set_derivedkeys(username_token,env,AXIS2_TRUE);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else
+        return AXIS2_FAILURE;
+}

Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/builder/username_token_builder.c
------------------------------------------------------------------------------
    svn:executable = *

Added: webservices/axis2/trunk/c/rampart/src/secpolicy/builder/wss10_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/builder/wss10_builder.c?view=auto&rev=498596
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/secpolicy/builder/wss10_builder.c (added)
+++ webservices/axis2/trunk/c/rampart/src/secpolicy/builder/wss10_builder.c Mon Jan 22 04:37:57 2007
@@ -0,0 +1,139 @@
+/*
+ * 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_wss10_builder.h>
+
+AXIS2_EXTERN rp_wss10_t *AXIS2_CALL
+rp_wss10_builder_build(
+            const axis2_env_t *env,
+            axiom_node_t *wss)
+{
+    rp_wss10_t *wss10 = NULL;
+    axis2_status_t status = AXIS2_SUCCESS;
+    axiom_node_t *policy = NULL;
+    axiom_element_t *pol_ele = NULL;
+
+    AXIS2_ENV_CHECK(env,NULL);
+
+    wss10 = rp_wss10_create(env);
+    if(!wss10)
+        return NULL;
+
+    policy = AXIOM_NODE_GET_FIRST_CHILD(wss,env);
+
+    if(AXIOM_NODE_GET_NODE_TYPE(policy, env) == AXIOM_ELEMENT)
+    {
+        pol_ele = (axiom_element_t*)AXIOM_NODE_GET_DATA_ELEMENT(policy, env);
+        if(pol_ele)
+        {
+            axiom_children_iterator_t *children_iter = NULL;
+            children_iter = AXIOM_ELEMENT_GET_CHILDREN(pol_ele, env, policy);
+            if(children_iter )
+            {
+                while(AXIOM_CHILDREN_ITERATOR_HAS_NEXT(children_iter, env))
+                {
+                    axiom_node_t *node = NULL;
+                    axiom_element_t *ele = NULL;
+                    axis2_char_t *local_name = NULL;
+                    node = AXIOM_CHILDREN_ITERATOR_NEXT(children_iter, env);
+                    if(node)
+                    {
+                        if(AXIOM_NODE_GET_NODE_TYPE(node, env) == AXIOM_ELEMENT)
+                        {
+                            ele = (axiom_element_t*)AXIOM_NODE_GET_DATA_ELEMENT(node, env);
+                            if(ele)
+                            {
+                                local_name = AXIOM_ELEMENT_GET_LOCALNAME(ele,env);
+                                if(local_name)
+                                {
+                                    status = rp_wss10_builder_set_properties(node,ele,local_name,wss10,env);
+                                    if(status!=AXIS2_SUCCESS)
+                                    {
+                                        rp_wss10_free(wss10,env);
+                                        wss10 = NULL;
+                                    }                           
+                                }
+                            }
+                            
+                        }
+                    }
+                }
+            }
+        }
+    }
+    return wss10;
+}            
+
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_wss10_builder_set_properties(
+        axiom_node_t *node,
+        axiom_element_t *element,
+        axis2_char_t *local_name,
+        rp_wss10_t *wss10,
+        const axis2_env_t *env)
+{
+    AXIS2_ENV_CHECK(env,AXIS2_FAILURE);
+
+    if(strcmp(local_name,RP_MUST_SUPPORT_REF_KEY_IDENTIFIER)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_MUST_SUPPORT_REF_KEY_IDENTIFIER,node,element))
+        {
+            rp_wss10_set_must_support_ref_key_identifier(wss10,env,AXIS2_TRUE);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else if(strcmp(local_name,RP_MUST_SUPPORT_REF_ISSUER_SERIAL)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_MUST_SUPPORT_REF_ISSUER_SERIAL,node,element))
+        {
+            rp_wss10_set_must_support_ref_issuer_serial(wss10,env,AXIS2_TRUE);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else if(strcmp(local_name,RP_MUST_SUPPORT_REF_EXTERNAL_URI)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_MUST_SUPPORT_REF_EXTERNAL_URI,node,element))
+        {
+            rp_wss10_set_must_support_ref_external_uri(wss10,env,AXIS2_TRUE);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else if(strcmp(local_name,RP_MUST_SUPPORT_REF_EMBEDDED_TOKEN)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_MUST_SUPPORT_REF_EMBEDDED_TOKEN,node,element))
+        {
+            rp_wss10_set_must_support_ref_embedded_token(wss10,env,AXIS2_TRUE);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else
+        return AXIS2_FAILURE;
+}

Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/builder/wss10_builder.c
------------------------------------------------------------------------------
    svn:executable = *

Added: webservices/axis2/trunk/c/rampart/src/secpolicy/builder/wss11_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/builder/wss11_builder.c?view=auto&rev=498596
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/secpolicy/builder/wss11_builder.c (added)
+++ webservices/axis2/trunk/c/rampart/src/secpolicy/builder/wss11_builder.c Mon Jan 22 04:37:57 2007
@@ -0,0 +1,174 @@
+/*
+ * 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_wss11_builder.h>
+
+AXIS2_EXTERN rp_wss11_t *AXIS2_CALL
+rp_wss11_builder_build(
+            const axis2_env_t *env,
+            axiom_node_t *wss)
+{
+    rp_wss11_t *wss11 = NULL;
+    axis2_status_t status = AXIS2_SUCCESS;
+    axiom_node_t *policy = NULL;
+    axiom_element_t *pol_ele = NULL;
+
+    AXIS2_ENV_CHECK(env,NULL);
+
+    wss11 = rp_wss11_create(env);
+    if(!wss11)
+        return NULL;
+
+    policy = AXIOM_NODE_GET_FIRST_CHILD(wss,env);
+
+    if(AXIOM_NODE_GET_NODE_TYPE(policy, env) == AXIOM_ELEMENT)
+    {
+        pol_ele = (axiom_element_t*)AXIOM_NODE_GET_DATA_ELEMENT(policy, env);
+        if(pol_ele)
+        {
+            axiom_children_iterator_t *children_iter = NULL;
+            children_iter = AXIOM_ELEMENT_GET_CHILDREN(pol_ele,env,policy);
+            if(children_iter )
+            {
+                while(AXIOM_CHILDREN_ITERATOR_HAS_NEXT(children_iter, env))
+                {
+                    axiom_node_t *node = NULL;
+                    axiom_element_t *ele = NULL;
+                    axis2_char_t *local_name = NULL;
+                    node = AXIOM_CHILDREN_ITERATOR_NEXT(children_iter, env);
+                    if(node)
+                    {
+                        if(AXIOM_NODE_GET_NODE_TYPE(node, env) == AXIOM_ELEMENT)
+                        {
+                            ele = (axiom_element_t*)AXIOM_NODE_GET_DATA_ELEMENT(node, env);
+                            if(ele)
+                            {
+                                local_name = AXIOM_ELEMENT_GET_LOCALNAME(ele,env);
+                                if(local_name)
+                                {
+                                    status = rp_wss11_builder_set_properties(node,ele,local_name,wss11,env);
+                                    if(status!=AXIS2_SUCCESS)
+                                    {
+                                        rp_wss11_free(wss11,env);
+                                        wss11 = NULL;
+                                    }                           
+                                }
+                            }
+                            
+                        }
+                    }
+                }
+            }
+        }
+    }
+    return wss11;
+}            
+
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_wss11_builder_set_properties(
+        axiom_node_t *node,
+        axiom_element_t *element,
+        axis2_char_t *local_name,
+        rp_wss11_t *wss11,
+        const axis2_env_t *env)
+{
+    AXIS2_ENV_CHECK(env,AXIS2_FAILURE);
+
+    if(strcmp(local_name,RP_MUST_SUPPORT_REF_KEY_IDENTIFIER)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_MUST_SUPPORT_REF_KEY_IDENTIFIER,node,element))
+        {
+            rp_wss11_set_must_support_ref_key_identifier(wss11,env,AXIS2_TRUE);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else if(strcmp(local_name,RP_MUST_SUPPORT_REF_ISSUER_SERIAL)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_MUST_SUPPORT_REF_ISSUER_SERIAL,node,element))
+        {
+            rp_wss11_set_must_support_ref_issuer_serial(wss11,env,AXIS2_TRUE);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else if(strcmp(local_name,RP_MUST_SUPPORT_REF_EXTERNAL_URI)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_MUST_SUPPORT_REF_EXTERNAL_URI,node,element))
+        {
+            rp_wss11_set_must_support_ref_external_uri(wss11,env,AXIS2_TRUE);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else if(strcmp(local_name,RP_MUST_SUPPORT_REF_EMBEDDED_TOKEN)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_MUST_SUPPORT_REF_EMBEDDED_TOKEN,node,element))
+        {
+            rp_wss11_set_must_support_ref_embedded_token(wss11,env,AXIS2_TRUE);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+ /*   else if(strcmp(local_name,RP_MUST_SUPPORT_REF_THUMBPRINT)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_MUST_SUPPORT_REF_THUMBPRINT,node,element))
+        {
+            rp_wss11_set_must_support_ref_thumbprint(wss11,env,AXIS2_TRUE);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+   */ else if(strcmp(local_name,RP_MUST_SUPPORT_REF_ENCRYPTED_KEY)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_MUST_SUPPORT_REF_ENCRYPTED_KEY,node,element))
+        {
+            rp_wss11_set_must_support_ref_encryptedkey(wss11,env,AXIS2_TRUE);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else if(strcmp(local_name,RP_REQUIRE_SIGNATURE_CONFIRMATION)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_REQUIRE_SIGNATURE_CONFIRMATION,node,element))
+        {
+            rp_wss11_set_require_signature_confirmation(wss11,env,AXIS2_TRUE);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else
+        return AXIS2_FAILURE;
+
+}

Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/builder/wss11_builder.c
------------------------------------------------------------------------------
    svn:executable = *

Added: webservices/axis2/trunk/c/rampart/src/secpolicy/builder/x509_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/builder/x509_token_builder.c?view=auto&rev=498596
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/secpolicy/builder/x509_token_builder.c (added)
+++ webservices/axis2/trunk/c/rampart/src/secpolicy/builder/x509_token_builder.c Mon Jan 22 04:37:57 2007
@@ -0,0 +1,269 @@
+/*
+ * 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_x509_token_builder.h>
+
+AXIS2_EXTERN rp_x509_token_t *AXIS2_CALL
+rp_x509_token_builder_build(
+            const axis2_env_t *env,
+            axiom_node_t *x509,
+            axiom_element_t *x509_ele)
+{
+    rp_x509_token_t *x509_token = NULL;
+    axiom_node_t *policy = NULL;
+    axiom_element_t *pol_ele = NULL;
+    axis2_status_t status = AXIS2_SUCCESS;
+
+    AXIS2_ENV_CHECK(env,NULL);
+
+    x509_token = rp_x509_token_create(env);
+    if(!x509_token)
+        return NULL;
+
+    status = rp_x509_token_builder_set_inclusion_value(env,x509_token,x509_ele);
+    if(status != AXIS2_SUCCESS )
+    {
+        rp_x509_token_free(x509_token,env);
+        x509_token = NULL;
+        return NULL;
+    }
+    policy = AXIOM_NODE_GET_FIRST_CHILD(x509,env);
+    if(AXIOM_NODE_GET_NODE_TYPE(policy, env) == AXIOM_ELEMENT)
+    {
+        pol_ele = (axiom_element_t*)AXIOM_NODE_GET_DATA_ELEMENT(policy, env);
+        if(pol_ele)
+        {
+            axiom_children_iterator_t *children_iter = NULL;
+            children_iter = AXIOM_ELEMENT_GET_CHILDREN(pol_ele, env, policy);
+            if(children_iter )
+            {
+                while(AXIOM_CHILDREN_ITERATOR_HAS_NEXT(children_iter, env))
+                {
+                    axiom_node_t *node = NULL;
+                    axiom_element_t *ele = NULL;
+                    axis2_char_t *local_name = NULL;
+                    node = AXIOM_CHILDREN_ITERATOR_NEXT(children_iter, env);
+                    if(node)
+                    {
+                        if(AXIOM_NODE_GET_NODE_TYPE(node, env) == AXIOM_ELEMENT)
+                        {
+                            ele = (axiom_element_t*)AXIOM_NODE_GET_DATA_ELEMENT(node, env);
+                            if(ele)
+                            {
+                                local_name = AXIOM_ELEMENT_GET_LOCALNAME(ele,env);
+                                if(local_name)
+                                {
+                                    status = rp_x509_token_builder_set_properties(node,ele,local_name,x509_token,env);
+                                    if(status != AXIS2_SUCCESS)
+                                    {
+                                        rp_x509_token_free(x509_token,env);
+                                        x509_token = NULL;
+                                        break;
+                                    }
+                                }
+                            }
+                            
+                        }
+                    }
+                }
+            }
+        }
+    }
+    return x509_token;
+}            
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+rp_x509_token_builder_set_inclusion_value(
+        const axis2_env_t *env,
+        rp_x509_token_t *token,
+        axiom_element_t *element)
+{
+    
+	axis2_char_t *inclusion_value = NULL;
+    axis2_qname_t *qname = NULL;
+	
+	AXIS2_ENV_CHECK(env,AXIS2_FAILURE);
+    qname = axis2_qname_create(env,RP_INCLUDE_TOKEN,RP_SP_NS,RP_SP_PREFIX);
+    if(!qname)
+        return AXIS2_FAILURE;
+    
+    inclusion_value = AXIOM_ELEMENT_GET_ATTRIBUTE_VALUE(element,env,qname);
+            
+    AXIS2_QNAME_FREE(qname,env);
+    qname = NULL;         
+
+    return rp_x509_token_set_inclusion(token,env,inclusion_value);    
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_x509_token_builder_set_properties(
+        axiom_node_t *node,
+        axiom_element_t *element,
+        axis2_char_t *local_name,
+        rp_x509_token_t *x509_token,
+        const axis2_env_t *env)
+{
+    AXIS2_ENV_CHECK(env,RP_AXIS2_FAILURE);
+
+    if(strcmp(local_name,RP_REQUIRE_KEY_IDENTIFIRE_REFERENCE)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_REQUIRE_KEY_IDENTIFIRE_REFERENCE,node,element))
+        {
+            rp_x509_token_set_require_key_identifier_reference(x509_token,env,AXIS2_TRUE);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else if(strcmp(local_name,RP_REQUIRE_ISSUER_SERIAL_REFERENCE)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_REQUIRE_ISSUER_SERIAL_REFERENCE,node,element))
+        {
+            rp_x509_token_set_require_issuer_serial_reference(x509_token,env,AXIS2_TRUE);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else if(strcmp(local_name,RP_REQUIRE_EMBEDDED_TOKEN_REFERENCE)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_REQUIRE_EMBEDDED_TOKEN_REFERENCE,node,element))
+        {
+            rp_x509_token_set_require_embedded_token_reference(x509_token,env,AXIS2_TRUE);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else if(strcmp(local_name,RP_REQUIRE_THUMBPRINT_REFERENCE)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_REQUIRE_THUMBPRINT_REFERENCE,node,element))
+        {
+            rp_x509_token_set_require_thumb_print_reference(x509_token,env,AXIS2_TRUE);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else if(strcmp(local_name,RP_REQUIRE_DERIVED_KEYS)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_REQUIRE_DERIVED_KEYS,node,element))
+        {
+            rp_x509_token_set_derivedkeys(x509_token,env,AXIS2_TRUE);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else if(strcmp(local_name,RP_WSS_X509_V1_TOKEN_10)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_WSS_X509_V1_TOKEN_10,node,element))
+        {
+            rp_x509_token_set_token_version_and_type(x509_token,env,local_name);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else if(strcmp(local_name,RP_WSS_X509_V3_TOKEN_10)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_WSS_X509_V3_TOKEN_10,node,element))
+        {
+            rp_x509_token_set_token_version_and_type(x509_token,env,local_name);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else if(strcmp(local_name,RP_WSS_X509_PKCS7_TOKEN_10)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_WSS_X509_PKCS7_TOKEN_10,node,element))
+        {
+            rp_x509_token_set_token_version_and_type(x509_token,env,local_name);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else if(strcmp(local_name,RP_WSS_X509_PKI_PATH_V1_TOKEN_10)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_WSS_X509_PKI_PATH_V1_TOKEN_10,node,element))
+        {
+            rp_x509_token_set_token_version_and_type(x509_token,env,local_name);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;   
+    }
+    else if(strcmp(local_name,RP_WSS_X509_V1_TOKEN_11)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_WSS_X509_V1_TOKEN_11,node,element))
+        {
+            rp_x509_token_set_token_version_and_type(x509_token,env,local_name);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else if(strcmp(local_name,RP_WSS_X509_V3_TOKEN_11)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_WSS_X509_V3_TOKEN_11,node,element))
+        {
+            rp_x509_token_set_token_version_and_type(x509_token,env,local_name);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else if(strcmp(local_name,RP_WSS_X509_PKCS7_TOKEN_11)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_WSS_X509_PKCS7_TOKEN_11,node,element))
+        {
+            rp_x509_token_set_token_version_and_type(x509_token,env,local_name);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else if(strcmp(local_name,RP_WSS_X509_PKI_PATH_V1_TOKEN_11)==0)
+    {
+        if(rp_match_secpolicy_qname(env,RP_WSS_X509_PKI_PATH_V1_TOKEN_11,node,element))
+        {
+            rp_x509_token_set_token_version_and_type(x509_token,env,local_name);
+            printf("%s\n",local_name);
+            return AXIS2_SUCCESS;
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    else
+        return AXIS2_FAILURE;
+}

Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/builder/x509_token_builder.c
------------------------------------------------------------------------------
    svn:executable = *

Added: webservices/axis2/trunk/c/rampart/src/secpolicy/model/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/model/Makefile.am?view=auto&rev=498596
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/secpolicy/model/Makefile.am (added)
+++ webservices/axis2/trunk/c/rampart/src/secpolicy/model/Makefile.am Mon Jan 22 04:37:57 2007
@@ -0,0 +1,18 @@
+TESTS =
+
+noinst_LTLIBRARIES = librp_model.la
+
+librp_model_la_SOURCES = algorithmsuite.c asymmetric_binding.c \
+							binding_commons.c encryption_crypto.c header.c https_token.c layout.c \
+							property.c rampart_config.c secpolicy.c security_context_token.c signature_crypto.c \
+							signed_encrypted_elements.c signed_encrypted_parts.c supporting_tokens.c symmetric_asymmetric_binding_commons.c\							symmetric_binding.c transport_binding.c ut.c wss10.c wss11.c x509_token.c
+
+
+librp_model_la_LIBADD  = ../../../../util/src/libaxis2_util.la \
+						 ../../../../axiom/src/om/libaxis2_axiom.la
+
+
+INCLUDES = -I$(top_builddir)/include \
+			-I ../../../../include \
+			-I ../../../../util/include \
+			-I ../../../../axiom/include

Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/model/Makefile.am
------------------------------------------------------------------------------
    svn:executable = *

Added: webservices/axis2/trunk/c/rampart/src/secpolicy/model/algorithmsuite.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/secpolicy/model/algorithmsuite.c?view=auto&rev=498596
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/secpolicy/model/algorithmsuite.c (added)
+++ webservices/axis2/trunk/c/rampart/src/secpolicy/model/algorithmsuite.c Mon Jan 22 04:37:57 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 axis2_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 axis2_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 axis2_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 axis2_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(AXIS2_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(AXIS2_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(AXIS2_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(AXIS2_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(AXIS2_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(AXIS2_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(AXIS2_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(AXIS2_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(AXIS2_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(AXIS2_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(AXIS2_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(AXIS2_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(AXIS2_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(AXIS2_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(AXIS2_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(AXIS2_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 axis2_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 axis2_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 axis2_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 axis2_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 axis2_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 axis2_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 axis2_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 axis2_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 axis2_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 axis2_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 axis2_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 axis2_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 axis2_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 axis2_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 axis2_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 axis2_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 axis2_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 axis2_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 axis2_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 axis2_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 axis2_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 axis2_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 axis2_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 axis2_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 axis2_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 axis2_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 axis2_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;
+}

Propchange: webservices/axis2/trunk/c/rampart/src/secpolicy/model/algorithmsuite.c
------------------------------------------------------------------------------
    svn:executable = *



---------------------------------------------------------------------
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