Author: milinda
Date: Fri Oct  5 06:23:23 2007
New Revision: 582252

URL: http://svn.apache.org/viewvc?rev=582252&view=rev
Log:
Adding entropy processing, not completed. Formatting changes.

Modified:
    webservices/rampart/scratch/c/trust/include/trust_constants.h
    webservices/rampart/scratch/c/trust/include/trust_data.h
    webservices/rampart/scratch/c/trust/src/data.c

Modified: webservices/rampart/scratch/c/trust/include/trust_constants.h
URL: 
http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/include/trust_constants.h?rev=582252&r1=582251&r2=582252&view=diff
==============================================================================
--- webservices/rampart/scratch/c/trust/include/trust_constants.h (original)
+++ webservices/rampart/scratch/c/trust/include/trust_constants.h Fri Oct  5 
06:23:23 2007
@@ -34,11 +34,15 @@
 #define TRUST_TOKEN_TYPE               "TokenType"
 #define TRUST_REQUEST_TYPE             "RequestType"
 #define TRUST_APPLIES_TO               "AppliesTo"
-#define TRUST_ENTROPY                  "Entropy"
+
 #define TRSUT_KEY_TYPE                 "KeyType"
-#define TRUST_KEY_SIZE                 "KeySize"
+#define TRUST_KEY_SIZE                 "KeySize"
+
 #define TRUST_CLAIMS                   "Claims"
-#define TRUST_CLAIMS_DIALECT   "Dialect"
+#define TRUST_CLAIMS_DIALECT   "Dialect"
+
+#define TRUST_ENTROPY                  "Entropy"
+#define TRUST_BINARY_SECRET            "BinarySecret"
 
 #define TRUST_LIFE_TIME                        "LifeTime"
 #define TRUST_TIMESTAMP_CREATED        "Created"

Modified: webservices/rampart/scratch/c/trust/include/trust_data.h
URL: 
http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/include/trust_data.h?rev=582252&r1=582251&r2=582252&view=diff
==============================================================================
--- webservices/rampart/scratch/c/trust/include/trust_data.h (original)
+++ webservices/rampart/scratch/c/trust/include/trust_data.h Fri Oct  5 
06:23:23 2007
@@ -27,11 +27,13 @@
 #include <stdlib.h>
 #include <axutil_utils.h>
 #include <axutil_string.h>
+#include <axutil_base64.h>
 #include <axiom_soap.h>
 #include <axiom.h>
 #include <axis2_msg_ctx.h>
 #include <axi2_addr.h>
-#include "trust_constants.h"
+#include <trust_constants.h>
+
 
 #ifdef __cplusplus
 extern "C" {
@@ -77,6 +79,10 @@
 
        AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_data_process_token_type(
                trust_data_t *trust_data, 
+               const axutil_env_t *env);
+
+       AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_data_process_entropy(
+               trust_data *trust_data,
                const axutil_env_t *env);
 
 

Modified: webservices/rampart/scratch/c/trust/src/data.c
URL: 
http://svn.apache.org/viewvc/webservices/rampart/scratch/c/trust/src/data.c?rev=582252&r1=582251&r2=582252&view=diff
==============================================================================
--- webservices/rampart/scratch/c/trust/src/data.c (original)
+++ webservices/rampart/scratch/c/trust/src/data.c Fri Oct  5 06:23:23 2007
@@ -1,287 +1,310 @@
-/*
- * 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 <trust_data.h>
-
-struct trust_data {
-       /* in message context of STS */
-       axis2_msg_ctx_t *in_msg_cntx;
-
-       /* Axiom node which holds payload of RST message */
-       axiom_node_t *rst_node;
-
-       /** Request Type
-         * e.g. wsse:ReqIssue/Validate/Renew etc 
-         */
-       axis2_char_t *request_type;             
-
-       /** Required Token Type
-         * e.g. wsse:X509v3
-         */
-       axis2_char_t *token_type;
-
-       /*optional element specifies the scope for which this security token is 
desired*/
-       axiom_node_t *applies_to_epr_node;
-
-       axis2_char_t *applies_to_address;
-
-       /** RST Context attribute       
-         * This optional URI specifies an identifier/context for this request
-         */
-       axis2_char_t *rst_context_attr; 
-
-       /* KeyType element of the RST */
-       axis2_char_t *key_type;                                 
-
-       /*optional element for specific set of requested claims*/
-    axiom_node_t *claims_node;
-
-       /**wst:RequestSecurityToken/wst:[EMAIL PROTECTED]
-         *Attribute specifies a URI to indicate the syntax of the claims
-         */
-       axis2_char_t *claims_dialect;
-
-       /* SOAP Namespace */
-       axis2_char_t *soap_namespace;   
-
-       /* WS-Trust Namespace */
-       axis2_char_t *wst_namespace;
-
-       /*Addressing NS */
-       axis2_char_t *addressing_namespace; 
-};
-
-AXIS2_EXPORT trust_data_t* AXIS2_CALL trust_data_create(
-               const axis2_msg_ctx_t *in_msg_ctx, 
-               const axutil_env_t *env)
-{
-       axiom_soap_envelope_t *soap_env =NULL;
-       axiom_soap_body_t *soap_body = NULL;
-       axiom_namespace_t *soap_ns = NULL; 
-       axiom_namespace_t *wst_ns = NULL;
-       axiom_node_t *rst_node = NULL;
-       axiom_element_t *rst_ele = NULL;
-
-       
-
-       trust_data_t *trust_data = (trust_data_t*)AXIS2_MALLOC(env->allocator, 
sizeof(trust_data_t));
-       
-       /* Processing Message Context */
-       soap_env = axis2_msg_ctx_get_soap_envelope(in_msg_ctx, env);
-       soap_body = axiom_soap_envelope_get_body(soap_env, env);
-       rst_node = axiom_soap_body_get_base_node(soap_body, env);
-       trust_data->rst_node = rst_node;
-       
-
-       /* Processing SOAP Namespace */
-       soap_ns = axiom_soap_envelope_get_namespace(soap_env, env);
-       trust_data->soap_namespace = axiom_namespace_get_uri(soap_ns, env);
-
-       /* Processing WS-Trust namespace */
-       rst_ele = (axiom_element_t *)axiom_node_get_data_element(rst_node, env);
-       wst_ns = axiom_element_get_namespace(rst_ele, env, rst_node);
-       
-       trust_data->wst_namespace = axiom_namespace_get_uri(wst_ns, env);  
-
-       trust_data_process_request_type(trust_data, env);
-       trust_data_process_token_type(trust_data, env);
-
-       /* TODO: Process other fields */        
-       /* TODO: Addressing namespace processing */
-       return trust_data;
-}
-
-AXIS2_EXPORT void AXIS2_CALL trust_data_free(
-               trust_data_t *trust_data, 
-               const axutil_env_t *env)
-{
-       AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
-       if(trust_data)
-       {
-               AXIS2_FREE(env->allocator, trust_data);
-       }
-}
-
-AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_data_process_applies_to(
-               trust_data_t *trust_data,
-               const axutil_env_t *env)
-{
-       axutil_qname_t *applies_to_qname = NULL;
-       axutil_qname_t *addr_qname = NULL;
-       axiom_node_t *appliesto_node = NULL;
-       axiom_node_t *rst_node = NULL;
-       axiom_node_t *epr_node = NULL;
-       axiom_node_t *addr_node = NULL;
-       axiom_element_t *appliesto_ele = NULL;
-       axiom_element_t *rst_ele = NULL;
-       axiom_element_t *epr_ele = NULL;
-       axiom_element_t *addr_ele = NULL;
-       axiom_namespace_t *addr_namespace = NULL:
-
-       AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
-       rst_node = trust_data->rst_node;
-    rst_ele = (axiom_element_t *)(axiom_node_get_data_element(rst_node, env));
-
-       applies_to_qname = axutil_qname_create(env, TRUST_APPLIES_TO, 
TRUST_WSP_XMLNS, TRUST_WSP);
-
-       appliesto_ele = axiom_element_get_first_child_with_qname(rst_ele, env, 
applies_to_qname, rst_node, &appliesto_node);
-    if(appliesto_ele)
-       {
-               epr_ele = axiom_element_get_first_element(appliesto_ele, env, 
appliesto_node, epr_node);
-               trust_data->applies_to_epr_node = epr_node;
-
-               if(!trust_data->addressing_namespace) 
-               {
-                       addressing_namespace = 
axiom_element_get_default_namespace(epr_ele, env, epr_node);
-                       trust_data->addressing_namespace = 
axiom_namespace_get_uri(addressing_namespace, env);
-               }
-
-               if(epr_ele)
-               {
-                       addr_qname = axutil_qname_create(env, EPR_ADDRESS, 
trust_data->addressing_namespace, NULL);
-                       addr_ele = 
axiom_element_get_first_child_with_qname(epr_ele, env, addr_qname, epr_node, 
&addr_node);
-                       if(addr_ele && axiom_element_get_text(addr_ele, env, 
addr_node))
-                       {
-                               trust_data->applies_to_address = 
axiom_element_get_text(addr_ele, env, addr_node);
-                       }
-               }else
-               {
-                       return AXIS2_FAILURE;
-               }
-
-       }else{
-               return AXIS2_FAILURE;
-       }
-       return AXIS2_SUCCESS;
-}
-
-AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_data_process_request_context(
-               trust_data_t *trust_data,
-               const axutil_env_t *env)
-{
-       axiom_element_t *rst_ele = NULL;
-       axutil_qname_t *attr_ctx_qname = NULL;
-       axis2_char_t *context = NULL;
-
-       AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-       
-       attr_ctx_qname = axutil_qname_create(env, TRUST_RST_CONTEXT, 
TRUST_WST_XMLNS, TRUST_WST);
-       if(!attr_ctx_qname)
-               return AXIS2_FAILURE;
-
-       rst_ele = 
(axiom_element_t*)(axiom_node_get_data_element(trust_data->rst_node, env));
-       context = axiom_element_get_attribute_value(rst_ele, env, 
attr_ctx_qname);
-
-       if(context)
-       {
-               trust_data->rst_context_attr = context;                 
-               return AXIS2_SUCCESS;
-       }
-       return AXIS2_FAILURE;
-}
-
-AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_data_process_request_type(
-               trust_data_t *trust_data, 
-               const axutil_env_t *env)
-{
-       axiom_element_t *req_type_ele = NULL;
-       axiom_element_t *rst_ele = NULL;
-       axiom_node_t *rst_node = NULL; 
-       axiom_node_t *req_type_node = NULL;
-       axutil_qname_t *req_type_qname = NULL;
-
-       AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
-       rst_node = trust_data->rst_node;
-       rst_ele = (axiom_element_t *)(axiom_node_get_data_element(rst_node, 
env));
-       
-       req_type_qname = axutil_qname_create(env, TRUST_REQUEST_TYPE, 
trust_data->wst_namespace, TRUST_WST);
-
-       req_type_ele = axiom_element_get_first_child_with_qname(rst_ele, env, 
req_type_qname, rst_node, &req_type_node);
-       if(!req_type_ele)
-               return AXIS2_FAILURE;
-
-       trust_data->request_type = axiom_element_get_text( req_type_ele, env, 
req_type_node);
-
-       return AXIS2_SUCCESS;
-}
-
-AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_data_process_token_type(
-               trust_data_t *trust_data, 
-               const axutil_env_t *env)
-{
-       axiom_node_t* token_type_node = NULL;
-       axiom_element_t * token_type_ele = NULL;
-       axiom_element_t * rst_ele = NULL;
-       axutil_qname_t* token_type_qname = NULL;
-       
-       rst_ele = (axiom_element_t 
*)(axiom_node_get_data_element(trust_data->rst_node, env));
-       
-       token_type_qname = axutil_qname_create(env, TRUST_TOKEN_TYPE, 
trust_data->wst_namespace, TRUST_WST);
-       
-       token_type_ele = axiom_element_get_first_child_with_qname(rst_ele, env, 
token_type_qname, 
-               trust_data->rst_node, &token_type_node);
-       if(!token_type_ele)
-               return AXIS2_FAILURE;
-
-       trust_data->token_type = axiom_element_get_text( token_type_ele, env, 
token_type_node);
-
-       return AXIS2_SUCCESS;
-}
-
-AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_data_process_claims(
-    trust_data_t *trust_data,
-    axutil_env_t *env)
-{
-       axiom_node_t* claims_node = NULL;
-    axiom_element_t * claims_ele = NULL;
-    axiom_element_t * rst_ele = NULL;
-    axutil_qname_t* claims_qname = NULL;
-    axutil_qname_t *attr_dialect_qname = NULL;
-    axis2_char_t *dialect = NULL;
-
-       AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
-    rst_ele = (axiom_element_t 
*)(axiom_node_get_data_element(trust_data->rst_node, env));
-
-    claims_qname = axutil_qname_create(env, TRUST_CLAIMS, 
trust_data->wst_namespace, TRUST_WST);
-
-    claims_ele = axiom_element_get_first_child_with_qname(rst_ele, env, 
claims_qname,
-        trust_data->rst_node, &claims_node);
-    if(!claims_ele)
-        return AXIS2_FAILURE;
-
-    trust_data->claims_node = claims_node;
-
-    attr_dialect_qname = axutil_qname_create(env, TRUST_CLAIMS_DIALECT, 
trust_data->wst_namespace, TRUST_WST);
-    if(!attr_dialect_qname)
-       {
-        return AXIS2_FAILURE;
-       }
-
-    dialect = axiom_element_get_attribute_value(claims_ele, env, 
attr_dialect_qname);
-
-    if(!dialect)
-    {
-        return AXIS2_FAILURE;
-    }
-       trust_data->claims_dialect = dialect;
-
-    return AXIS2_SUCCESS;
-}
-
+/*
+ * 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 <trust_data.h>
+
+struct trust_data {
+       /* in message context of STS */
+       axis2_msg_ctx_t *in_msg_cntx;
+
+       /* Axiom node which holds payload of RST message */
+       axiom_node_t *rst_node;
+
+       /** Request Type
+         * e.g. wsse:ReqIssue/Validate/Renew etc 
+         */
+       axis2_char_t *request_type;             
+
+       /** Required Token Type
+         * e.g. wsse:X509v3
+         */
+       axis2_char_t *token_type;
+
+       /*optional element specifies the scope for which this security token is 
desired*/
+       axiom_node_t *applies_to_epr_node;
+
+       axis2_char_t *applies_to_address;
+
+       /** RST Context attribute       
+         * This optional URI specifies an identifier/context for this request
+         */
+       axis2_char_t *rst_context_attr; 
+
+       /* KeyType element of the RST */
+       axis2_char_t *key_type;                                 
+
+       /*optional element for specific set of requested claims*/
+    axiom_node_t *claims_node;
+
+       /**wst:RequestSecurityToken/wst:[EMAIL PROTECTED]
+         *Attribute specifies a URI to indicate the syntax of the claims
+         */
+       axis2_char_t *claims_dialect;
+
+       /* SOAP Namespace */
+       axis2_char_t *soap_namespace;   
+
+       /* WS-Trust Namespace */
+       axis2_char_t *wst_namespace;
+
+       /*Addressing NS */
+       axis2_char_t *addressing_namespace; 
+};
+
+AXIS2_EXPORT trust_data_t* AXIS2_CALL trust_data_create(
+               const axis2_msg_ctx_t *in_msg_ctx, 
+               const axutil_env_t *env)
+{
+       axiom_soap_envelope_t *soap_env =NULL;
+       axiom_soap_body_t *soap_body = NULL;
+       axiom_namespace_t *soap_ns = NULL; 
+       axiom_namespace_t *wst_ns = NULL;
+       axiom_node_t *rst_node = NULL;
+       axiom_element_t *rst_ele = NULL;
+
+       
+
+       trust_data_t *trust_data = (trust_data_t*)AXIS2_MALLOC(env->allocator, 
sizeof(trust_data_t));
+       
+       /* Processing Message Context */
+       soap_env = axis2_msg_ctx_get_soap_envelope(in_msg_ctx, env);
+       soap_body = axiom_soap_envelope_get_body(soap_env, env);
+       rst_node = axiom_soap_body_get_base_node(soap_body, env);
+       trust_data->rst_node = rst_node;
+       
+
+       /* Processing SOAP Namespace */
+       soap_ns = axiom_soap_envelope_get_namespace(soap_env, env);
+       trust_data->soap_namespace = axiom_namespace_get_uri(soap_ns, env);
+
+       /* Processing WS-Trust namespace */
+       rst_ele = (axiom_element_t *)axiom_node_get_data_element(rst_node, env);
+       wst_ns = axiom_element_get_namespace(rst_ele, env, rst_node);
+       
+       trust_data->wst_namespace = axiom_namespace_get_uri(wst_ns, env);  
+
+       trust_data_process_request_type(trust_data, env);
+       trust_data_process_token_type(trust_data, env);
+
+       /* TODO: Process other fields */        
+       /* TODO: Addressing namespace processing */
+       return trust_data;
+}
+
+AXIS2_EXPORT void AXIS2_CALL trust_data_free(
+               trust_data_t *trust_data, 
+               const axutil_env_t *env)
+{
+       AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+       if(trust_data)
+       {
+               AXIS2_FREE(env->allocator, trust_data);
+       }
+}
+
+AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_data_process_applies_to(
+               trust_data_t *trust_data,
+               const axutil_env_t *env)
+{
+       axutil_qname_t *applies_to_qname = NULL;
+       axutil_qname_t *addr_qname = NULL;
+       axiom_node_t *appliesto_node = NULL;
+       axiom_node_t *rst_node = NULL;
+       axiom_node_t *epr_node = NULL;
+       axiom_node_t *addr_node = NULL;
+       axiom_element_t *appliesto_ele = NULL;
+       axiom_element_t *rst_ele = NULL;
+       axiom_element_t *epr_ele = NULL;
+       axiom_element_t *addr_ele = NULL;
+       axiom_namespace_t *addr_namespace = NULL:
+
+       AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+       rst_node = trust_data->rst_node;
+    rst_ele = (axiom_element_t *)(axiom_node_get_data_element(rst_node, env));
+
+       applies_to_qname = axutil_qname_create(env, TRUST_APPLIES_TO, 
TRUST_WSP_XMLNS, TRUST_WSP);
+
+       appliesto_ele = axiom_element_get_first_child_with_qname(rst_ele, env, 
applies_to_qname, rst_node, &appliesto_node);
+    if(appliesto_ele)
+       {
+               epr_ele = axiom_element_get_first_element(appliesto_ele, env, 
appliesto_node, epr_node);
+               trust_data->applies_to_epr_node = epr_node;
+
+               if(!trust_data->addressing_namespace) 
+               {
+                       addressing_namespace = 
axiom_element_get_default_namespace(epr_ele, env, epr_node);
+                       trust_data->addressing_namespace = 
axiom_namespace_get_uri(addressing_namespace, env);
+               }
+
+               if(epr_ele)
+               {
+                       addr_qname = axutil_qname_create(env, EPR_ADDRESS, 
trust_data->addressing_namespace, NULL);
+                       addr_ele = 
axiom_element_get_first_child_with_qname(epr_ele, env, addr_qname, epr_node, 
&addr_node);
+                       if(addr_ele && axiom_element_get_text(addr_ele, env, 
addr_node))
+                       {
+                               trust_data->applies_to_address = 
axiom_element_get_text(addr_ele, env, addr_node);
+                       }
+               }else
+               {
+                       return AXIS2_FAILURE;
+               }
+
+       }else{
+               return AXIS2_FAILURE;
+       }
+       return AXIS2_SUCCESS;
+}
+
+AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_data_process_request_context(
+               trust_data_t *trust_data,
+               const axutil_env_t *env)
+{
+       axiom_element_t *rst_ele = NULL;
+       axutil_qname_t *attr_ctx_qname = NULL;
+       axis2_char_t *context = NULL;
+
+       AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+       
+       attr_ctx_qname = axutil_qname_create(env, TRUST_RST_CONTEXT, 
TRUST_WST_XMLNS, TRUST_WST);
+       if(!attr_ctx_qname)
+               return AXIS2_FAILURE;
+
+       rst_ele = 
(axiom_element_t*)(axiom_node_get_data_element(trust_data->rst_node, env));
+       context = axiom_element_get_attribute_value(rst_ele, env, 
attr_ctx_qname);
+
+       if(context)
+       {
+               trust_data->rst_context_attr = context;                 
+               return AXIS2_SUCCESS;
+       }
+       return AXIS2_FAILURE;
+}
+
+AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_data_process_request_type(
+               trust_data_t *trust_data, 
+               const axutil_env_t *env)
+{
+       axiom_element_t *req_type_ele = NULL;
+       axiom_element_t *rst_ele = NULL;
+       axiom_node_t *rst_node = NULL; 
+       axiom_node_t *req_type_node = NULL;
+       axutil_qname_t *req_type_qname = NULL;
+
+       AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+       rst_node = trust_data->rst_node;
+       rst_ele = (axiom_element_t *)(axiom_node_get_data_element(rst_node, 
env));
+       
+       req_type_qname = axutil_qname_create(env, TRUST_REQUEST_TYPE, 
trust_data->wst_namespace, TRUST_WST);
+
+       req_type_ele = axiom_element_get_first_child_with_qname(rst_ele, env, 
req_type_qname, rst_node, &req_type_node);
+       if(!req_type_ele)
+               return AXIS2_FAILURE;
+
+       trust_data->request_type = axiom_element_get_text( req_type_ele, env, 
req_type_node);
+
+       return AXIS2_SUCCESS;
+}
+
+AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_data_process_token_type(
+               trust_data_t *trust_data, 
+               const axutil_env_t *env)
+{
+       axiom_node_t* token_type_node = NULL;
+       axiom_element_t * token_type_ele = NULL;
+       axiom_element_t * rst_ele = NULL;
+       axutil_qname_t* token_type_qname = NULL;
+       
+       rst_ele = (axiom_element_t 
*)(axiom_node_get_data_element(trust_data->rst_node, env));
+       
+       token_type_qname = axutil_qname_create(env, TRUST_TOKEN_TYPE, 
trust_data->wst_namespace, TRUST_WST);
+       
+       token_type_ele = axiom_element_get_first_child_with_qname(rst_ele, env, 
token_type_qname, 
+               trust_data->rst_node, &token_type_node);
+       if(!token_type_ele)
+               return AXIS2_FAILURE;
+
+       trust_data->token_type = axiom_element_get_text( token_type_ele, env, 
token_type_node);
+
+       return AXIS2_SUCCESS;
+}
+
+AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_data_process_claims(
+    trust_data_t *trust_data,
+    axutil_env_t *env)
+{
+       axiom_node_t* claims_node = NULL;
+    axiom_element_t * claims_ele = NULL;
+    axiom_element_t * rst_ele = NULL;
+    axutil_qname_t* claims_qname = NULL;
+    axutil_qname_t *attr_dialect_qname = NULL;
+    axis2_char_t *dialect = NULL;
+
+       AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+    rst_ele = (axiom_element_t 
*)(axiom_node_get_data_element(trust_data->rst_node, env));
+
+    claims_qname = axutil_qname_create(env, TRUST_CLAIMS, 
trust_data->wst_namespace, TRUST_WST);
+
+    claims_ele = axiom_element_get_first_child_with_qname(rst_ele, env, 
claims_qname,
+        trust_data->rst_node, &claims_node);
+    if(!claims_ele)
+        return AXIS2_FAILURE;
+
+    trust_data->claims_node = claims_node;
+
+    attr_dialect_qname = axutil_qname_create(env, TRUST_CLAIMS_DIALECT, 
trust_data->wst_namespace, TRUST_WST);
+    if(!attr_dialect_qname)
+       {
+        return AXIS2_FAILURE;
+       }
+
+    dialect = axiom_element_get_attribute_value(claims_ele, env, 
attr_dialect_qname);
+
+    if(!dialect)
+    {
+        return AXIS2_FAILURE;
+    }
+       trust_data->claims_dialect = dialect;
+
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXPORT axis2_status_t AXIS2_CALL trust_data_process_entropy(
+        trust_data *trust_data,
+        const axutil_env_t *env)
+{
+       /* TO DO: Complete the entropy processing*/
+       axiom_node_t* entropy_node = NULL;
+    axiom_element_t * entropy_ele = NULL;
+    axiom_element_t * rst_ele = NULL;
+    axutil_qname_t* binary_secret_qname = NULL;
+    axutil_qname_t *entropy_qname = NULL;
+
+       AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+    rst_ele = (axiom_element_t 
*)(axiom_node_get_data_element(trust_data->rst_node, env));
+
+    claims_qname = axutil_qname_create(env, TRUST_CLAIMS, 
trust_data->wst_namespace, TRUST_WST);
+
+    claims_ele = axiom_element_get_first_child_with_qname(rst_ele, env, 
claims_qname,
+        trust_data->rst_node, &claims_node);
+    if(!claims_ele)
+        return AXIS2_FAILURE;
+       
+}


Reply via email to