You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rampart-dev@ws.apache.org by ka...@apache.org on 2007/10/10 10:06:12 UTC
svn commit: r583382 - in /webservices/rampart/trunk/c: include/oxs_tokens.h
src/omxmlsec/tokens/Makefile.am src/omxmlsec/tokens/token_generation.c
src/omxmlsec/tokens/token_properties.c
Author: kaushalye
Date: Wed Oct 10 01:06:11 2007
New Revision: 583382
URL: http://svn.apache.org/viewvc?rev=583382&view=rev
Log:
Introducing new tokens for WS Secure Conversation
1. <wsc:Generation>
2. <wsc:Properties>
Added:
webservices/rampart/trunk/c/src/omxmlsec/tokens/token_generation.c
webservices/rampart/trunk/c/src/omxmlsec/tokens/token_properties.c
Modified:
webservices/rampart/trunk/c/include/oxs_tokens.h
webservices/rampart/trunk/c/src/omxmlsec/tokens/Makefile.am
Modified: webservices/rampart/trunk/c/include/oxs_tokens.h
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/include/oxs_tokens.h?rev=583382&r1=583381&r2=583382&view=diff
==============================================================================
--- webservices/rampart/trunk/c/include/oxs_tokens.h (original)
+++ webservices/rampart/trunk/c/include/oxs_tokens.h Wed Oct 10 01:06:11 2007
@@ -544,6 +544,37 @@
+ /**
+ * Creates <wsc:Properties> element
+ */
+ AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+ oxs_token_build_properties_element(const axutil_env_t *env,
+ axiom_node_t *parent,
+ axis2_char_t* properties_val);
+
+ /**
+ * Gets value from <wsc:Properties> element
+ */
+ AXIS2_EXTERN axis2_char_t* AXIS2_CALL
+ oxs_token_get_properties_value(const axutil_env_t *env,
+ axiom_node_t *properties_node);
+
+ /**
+ * Creates <wsc:Generation> element
+ */
+ AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+ oxs_token_build_generation_element(const axutil_env_t *env,
+ axiom_node_t *parent,
+ axis2_char_t* generation_val);
+
+ /**
+ * Gets value from <wsc:Generation> element
+ */
+ AXIS2_EXTERN axis2_char_t* AXIS2_CALL
+ oxs_token_get_generation_value(const axutil_env_t *env,
+ axiom_node_t *generation_node);
+
+
/** @} */
Modified: webservices/rampart/trunk/c/src/omxmlsec/tokens/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/tokens/Makefile.am?rev=583382&r1=583381&r2=583382&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/tokens/Makefile.am (original)
+++ webservices/rampart/trunk/c/src/omxmlsec/tokens/Makefile.am Wed Oct 10 01:06:11 2007
@@ -8,7 +8,8 @@
token_embedded.c token_reference.c token_signature_value.c token_signed_info.c \
token_c14n_method.c token_signature_method.c token_digest_method.c token_digest_value.c \
token_transform.c token_transforms.c token_signature.c token_ds_reference.c \
- token_x509_certificate.c token_signature_confirmation.c token_derived_key_token.c
+ token_x509_certificate.c token_signature_confirmation.c token_derived_key_token.c \
+ token_properties.c token_generation.c
INCLUDES = -I$(top_builddir)/include \
Added: webservices/rampart/trunk/c/src/omxmlsec/tokens/token_generation.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/tokens/token_generation.c?rev=583382&view=auto
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/tokens/token_generation.c (added)
+++ webservices/rampart/trunk/c/src/omxmlsec/tokens/token_generation.c Wed Oct 10 01:06:11 2007
@@ -0,0 +1,66 @@
+/*
+ * 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 <stdio.h>
+#include <oxs_constants.h>
+#include <oxs_error.h>
+#include <oxs_tokens.h>
+#include <axiom_element.h>
+#include <oxs_axiom.h>
+
+
+AXIS2_EXTERN axis2_char_t* AXIS2_CALL
+oxs_token_get_generation_value(const axutil_env_t *env,
+ axiom_node_t *generation_node)
+{
+ axis2_char_t *value = NULL;
+ value = (axis2_char_t*)oxs_axiom_get_node_content(env, generation_node);
+ return value;
+
+}
+
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+oxs_token_build_generation_element(const axutil_env_t *env,
+ axiom_node_t *parent,
+ axis2_char_t* generation_val
+ )
+{
+ axiom_node_t *generation_node = NULL;
+ axiom_element_t *generation_ele = NULL;
+ axis2_status_t ret;
+ axiom_namespace_t *ns_obj = NULL;
+
+ ns_obj = axiom_namespace_create(env, OXS_WSC_NS,
+ OXS_WSC);
+
+ generation_ele = axiom_element_create(env, parent, OXS_NODE_OFFSET, ns_obj, &generation_node);
+ if (!generation_ele)
+ {
+ oxs_error(env, ERROR_LOCATION,
+ OXS_ERROR_ELEMENT_FAILED, "Error creating %s element", OXS_NODE_OFFSET);
+ return NULL;
+ }
+
+ if (generation_val)
+ {
+ ret = axiom_element_set_text(generation_ele, env, generation_val, generation_node);
+ }
+
+ return generation_node;
+
+}
+
Added: webservices/rampart/trunk/c/src/omxmlsec/tokens/token_properties.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/tokens/token_properties.c?rev=583382&view=auto
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/tokens/token_properties.c (added)
+++ webservices/rampart/trunk/c/src/omxmlsec/tokens/token_properties.c Wed Oct 10 01:06:11 2007
@@ -0,0 +1,66 @@
+/*
+ * 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 <stdio.h>
+#include <oxs_constants.h>
+#include <oxs_error.h>
+#include <oxs_tokens.h>
+#include <axiom_element.h>
+#include <oxs_axiom.h>
+
+
+AXIS2_EXTERN axis2_char_t* AXIS2_CALL
+oxs_token_get_properties_value(const axutil_env_t *env,
+ axiom_node_t *properties_node)
+{
+ axis2_char_t *value = NULL;
+ value = (axis2_char_t*)oxs_axiom_get_node_content(env, properties_node);
+ return value;
+
+}
+
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+oxs_token_build_properties_element(const axutil_env_t *env,
+ axiom_node_t *parent,
+ axis2_char_t* properties_val
+ )
+{
+ axiom_node_t *properties_node = NULL;
+ axiom_element_t *properties_ele = NULL;
+ axis2_status_t ret;
+ axiom_namespace_t *ns_obj = NULL;
+
+ ns_obj = axiom_namespace_create(env, OXS_WSC_NS,
+ OXS_WSC);
+
+ properties_ele = axiom_element_create(env, parent, OXS_NODE_OFFSET, ns_obj, &properties_node);
+ if (!properties_ele)
+ {
+ oxs_error(env, ERROR_LOCATION,
+ OXS_ERROR_ELEMENT_FAILED, "Error creating %s element", OXS_NODE_OFFSET);
+ return NULL;
+ }
+
+ if (properties_val)
+ {
+ ret = axiom_element_set_text(properties_ele, env, properties_val, properties_node);
+ }
+
+ return properties_node;
+
+}
+