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 pi...@apache.org on 2007/09/06 12:49:17 UTC
svn commit: r573215 [17/22] - in /webservices/rampart/tags/c/0.90: ./ build/
build/linux/ build/win32/ include/ samples/ samples/authn_provider/
samples/callback/ samples/callback/htpasswd_callback/ samples/client/
samples/client/sec_echo/ samples/clie...
Added: webservices/rampart/tags/c/0.90/src/secpolicy/model/layout.c
URL: http://svn.apache.org/viewvc/webservices/rampart/tags/c/0.90/src/secpolicy/model/layout.c?rev=573215&view=auto
==============================================================================
--- webservices/rampart/tags/c/0.90/src/secpolicy/model/layout.c (added)
+++ webservices/rampart/tags/c/0.90/src/secpolicy/model/layout.c Thu Sep 6 03:48:44 2007
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <rp_layout.h>
+
+struct rp_layout_t
+{
+ axis2_char_t *value;
+};
+
+AXIS2_EXTERN rp_layout_t *AXIS2_CALL
+rp_layout_create(const axutil_env_t *env)
+{
+ rp_layout_t *layout = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ layout = (rp_layout_t *) AXIS2_MALLOC (env->allocator,
+ sizeof (rp_layout_t));
+
+ if(layout == NULL)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ layout->value = RP_LAYOUT_STRICT;
+ return layout;
+
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_layout_free(rp_layout_t *layout,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ if(layout)
+ {
+ AXIS2_FREE(env->allocator, layout);
+ layout = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+
+/* Implementations */
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_layout_get_value(rp_layout_t *layout,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return layout->value;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_layout_set_value(rp_layout_t *layout,
+ const axutil_env_t *env,
+ axis2_char_t *value)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,value,AXIS2_FAILURE);
+
+ layout->value = value;
+ return AXIS2_SUCCESS;
+}
+
Added: webservices/rampart/tags/c/0.90/src/secpolicy/model/property.c
URL: http://svn.apache.org/viewvc/webservices/rampart/tags/c/0.90/src/secpolicy/model/property.c?rev=573215&view=auto
==============================================================================
--- webservices/rampart/tags/c/0.90/src/secpolicy/model/property.c (added)
+++ webservices/rampart/tags/c/0.90/src/secpolicy/model/property.c Thu Sep 6 03:48:44 2007
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <rp_property.h>
+#include <rp_symmetric_binding.h>
+#include <rp_asymmetric_binding.h>
+#include <rp_transport_binding.h>
+#include <rp_supporting_tokens.h>
+#include <rp_wss10.h>
+#include <rp_wss11.h>
+
+
+struct rp_property_t
+{
+ int type;
+ void *value;
+};
+
+
+AXIS2_EXTERN rp_property_t *AXIS2_CALL
+rp_property_create(const axutil_env_t *env)
+{
+ rp_property_t *property = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ property = (rp_property_t *) AXIS2_MALLOC (env->allocator,
+ sizeof (rp_property_t));
+
+ if(property == NULL)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ property->type = 0;
+ property->value = NULL;
+
+ return property;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_property_free(
+ rp_property_t *property,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ if(property)
+ {
+ if(property->value)
+ {
+ switch(property->type)
+ {
+ case RP_TOKEN_USERNAME:
+ rp_username_token_free((rp_username_token_t *)property->value,env);
+ property->value = NULL;
+ break;
+
+ case RP_TOKEN_X509:
+ rp_x509_token_free((rp_x509_token_t *)property->value,env);
+ property->value = NULL;
+ break;
+
+ case RP_TOKEN_SECURITY_CONTEXT:
+ rp_security_context_token_free((rp_security_context_token_t *)property->value,env);
+ property->value = NULL;
+ break;
+
+ case RP_TOKEN_HTTPS:
+ rp_https_token_free((rp_https_token_t *)property->value,env);
+ property->value = NULL;
+ break;
+
+ case RP_BINDING_SYMMETRIC:
+ rp_symmetric_binding_free((rp_symmetric_binding_t *)property->value,env);
+ property->value = NULL;
+ break;
+
+ case RP_BINDING_ASYMMETRIC:
+ rp_asymmetric_binding_free((rp_asymmetric_binding_t *)property->value,env);
+ property->value = NULL;
+ break;
+
+ case RP_BINDING_TRANSPORT:
+ rp_transport_binding_free((rp_transport_binding_t *)property->value,env);
+ property->value = NULL;
+ break;
+
+ case RP_SUPPORTING_SIGNED_SUPPORTING:
+ rp_supporting_tokens_free((rp_supporting_tokens_t *)property->value,env);
+ property->value = NULL;
+ break;
+
+ case RP_SUPPORTING_SIGNED_ENDORSING_SUPPORTING:
+ rp_supporting_tokens_free((rp_supporting_tokens_t *)property->value,env);
+ property->value = NULL;
+ break;
+
+ case RP_WSS_WSS10:
+ rp_wss10_free((rp_wss10_t *)property->value,env);
+ property->value = NULL;
+ break;
+
+ case RP_WSS_WSS11:
+ rp_wss11_free((rp_wss11_t *)property->value,env);
+ property->value = NULL;
+ break;
+ }
+ }
+ AXIS2_FREE(env->allocator,property);
+ }
+
+ return AXIS2_SUCCESS;
+}
+
+
+/* Implementations */
+AXIS2_EXTERN void *AXIS2_CALL
+rp_property_get_value(
+ rp_property_t *property,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return property->value;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_property_set_value(rp_property_t *property,
+ const axutil_env_t *env,
+ void *value,
+ int type)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,value,AXIS2_FAILURE);
+
+ property->type = type;
+ property->value =(void *)value;
+
+ return AXIS2_SUCCESS;
+
+}
+
+AXIS2_EXTERN int AXIS2_CALL
+rp_property_get_type(
+ rp_property_t *property,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return property->type;
+}
Added: webservices/rampart/tags/c/0.90/src/secpolicy/model/rampart_config.c
URL: http://svn.apache.org/viewvc/webservices/rampart/tags/c/0.90/src/secpolicy/model/rampart_config.c?rev=573215&view=auto
==============================================================================
--- webservices/rampart/tags/c/0.90/src/secpolicy/model/rampart_config.c (added)
+++ webservices/rampart/tags/c/0.90/src/secpolicy/model/rampart_config.c Thu Sep 6 03:48:44 2007
@@ -0,0 +1,277 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <rp_rampart_config.h>
+
+struct rp_rampart_config_t
+{
+ axis2_char_t *user;
+ axis2_char_t *encryption_user;
+ axis2_char_t *password_callback_class;
+ axis2_char_t *authenticate_module;
+ axis2_char_t *password_type;
+ axis2_char_t *time_to_live;
+ axis2_char_t *receiver_certificate_file;
+ axis2_char_t *certificate_file;
+ axis2_char_t *private_key_file;
+};
+
+AXIS2_EXTERN rp_rampart_config_t *AXIS2_CALL
+rp_rampart_config_create(const axutil_env_t *env)
+{
+ rp_rampart_config_t *rampart_config = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ rampart_config = (rp_rampart_config_t *) AXIS2_MALLOC (env->allocator,
+ sizeof (rp_rampart_config_t));
+
+ if(rampart_config == NULL)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ rampart_config->user = NULL;
+ rampart_config->encryption_user = NULL;
+ rampart_config->password_callback_class = NULL;
+ rampart_config->private_key_file = NULL;
+ rampart_config->receiver_certificate_file = NULL;
+ rampart_config->certificate_file = NULL;
+ rampart_config->authenticate_module = NULL;
+ rampart_config->password_type = NULL;
+ rampart_config->time_to_live = NULL;
+ return rampart_config;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_rampart_config_free(rp_rampart_config_t *rampart_config,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ if(rampart_config)
+ {
+ AXIS2_FREE(env->allocator,rampart_config);
+ rampart_config = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+
+/* Implementations */
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_rampart_config_get_user(
+ rp_rampart_config_t *rampart_config,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return rampart_config->user;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_rampart_config_set_user(rp_rampart_config_t *rampart_config,
+ const axutil_env_t *env,
+ axis2_char_t *user)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,user,AXIS2_FAILURE);
+
+ rampart_config->user = user;
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_rampart_config_get_encryption_user(
+ rp_rampart_config_t *rampart_config,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return rampart_config->encryption_user;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_rampart_config_set_encryption_user(rp_rampart_config_t *rampart_config,
+ const axutil_env_t *env,
+ axis2_char_t *encryption_user)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,encryption_user,AXIS2_FAILURE);
+
+ rampart_config->encryption_user = encryption_user;
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_rampart_config_get_password_callback_class(
+ rp_rampart_config_t *rampart_config,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return rampart_config->password_callback_class;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_rampart_config_set_password_callback_class(rp_rampart_config_t *rampart_config,
+ const axutil_env_t *env,
+ axis2_char_t *password_callback_class)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,password_callback_class,AXIS2_FAILURE);
+
+ rampart_config->password_callback_class = password_callback_class;
+ return AXIS2_SUCCESS;
+}
+
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_rampart_config_get_authenticate_module(
+ rp_rampart_config_t *rampart_config,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return rampart_config->authenticate_module;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_rampart_config_set_authenticate_module(rp_rampart_config_t *rampart_config,
+ const axutil_env_t *env,
+ axis2_char_t *authenticate_module)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,authenticate_module,AXIS2_FAILURE);
+
+ rampart_config->authenticate_module = authenticate_module;
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_rampart_config_get_password_type(
+ rp_rampart_config_t *rampart_config,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return rampart_config->password_type;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_rampart_config_set_password_type(rp_rampart_config_t *rampart_config,
+ const axutil_env_t *env,
+ axis2_char_t *password_type)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,password_type,AXIS2_FAILURE);
+
+ rampart_config->password_type = password_type;
+ return AXIS2_SUCCESS;
+}
+
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_rampart_config_get_private_key_file(
+ rp_rampart_config_t *rampart_config,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return rampart_config->private_key_file;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_rampart_config_set_private_key_file(rp_rampart_config_t *rampart_config,
+ const axutil_env_t *env,
+ axis2_char_t *private_key_file)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,private_key_file,AXIS2_FAILURE);
+
+ rampart_config->private_key_file = private_key_file;
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_rampart_config_get_receiver_certificate_file(
+ rp_rampart_config_t *rampart_config,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return rampart_config->receiver_certificate_file;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_rampart_config_set_receiver_certificate_file(rp_rampart_config_t *rampart_config,
+ const axutil_env_t *env,
+ axis2_char_t *receiver_certificate_file)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,receiver_certificate_file,AXIS2_FAILURE);
+
+ rampart_config->receiver_certificate_file = receiver_certificate_file;
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_rampart_config_get_certificate_file(
+ rp_rampart_config_t *rampart_config,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return rampart_config->certificate_file;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_rampart_config_set_certificate_file(rp_rampart_config_t *rampart_config,
+ const axutil_env_t *env,
+ axis2_char_t *certificate_file)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,certificate_file,AXIS2_FAILURE);
+
+ rampart_config->certificate_file = certificate_file;
+ return AXIS2_SUCCESS;
+}
+
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_rampart_config_get_time_to_live(
+ rp_rampart_config_t *rampart_config,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return rampart_config->time_to_live;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_rampart_config_set_time_to_live(rp_rampart_config_t *rampart_config,
+ const axutil_env_t *env,
+ axis2_char_t *time_to_live)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,time_to_live,AXIS2_FAILURE);
+
+ rampart_config->time_to_live = time_to_live;
+ return AXIS2_SUCCESS;
+}
Added: webservices/rampart/tags/c/0.90/src/secpolicy/model/secpolicy.c
URL: http://svn.apache.org/viewvc/webservices/rampart/tags/c/0.90/src/secpolicy/model/secpolicy.c?rev=573215&view=auto
==============================================================================
--- webservices/rampart/tags/c/0.90/src/secpolicy/model/secpolicy.c (added)
+++ webservices/rampart/tags/c/0.90/src/secpolicy/model/secpolicy.c Thu Sep 6 03:48:44 2007
@@ -0,0 +1,455 @@
+/*
+ * 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_secpolicy.h>
+
+struct rp_secpolicy_t
+{
+ rp_property_t *binding;
+ rp_property_t *wss;
+ rp_supporting_tokens_t *supporting_tokens;
+ rp_supporting_tokens_t *signed_supporting_tokens;
+ rp_supporting_tokens_t *endorsing_supporting_tokens;
+ rp_supporting_tokens_t *signed_endorsing_supporting_tokens;
+ rp_signed_encrypted_parts_t *signed_parts;
+ rp_signed_encrypted_parts_t *encrypted_parts;
+ rp_signed_encrypted_elements_t *signed_elements;
+ rp_signed_encrypted_elements_t *encrypted_elements;
+ rp_signed_encrypted_items_t *signed_items;
+ rp_signed_encrypted_items_t *encrypted_items;
+ rp_rampart_config_t *rampart_config;
+
+};
+
+AXIS2_EXTERN rp_secpolicy_t *AXIS2_CALL
+rp_secpolicy_create(const axutil_env_t *env)
+{
+ rp_secpolicy_t *secpolicy = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ secpolicy = (rp_secpolicy_t *) AXIS2_MALLOC (env->allocator,
+ sizeof (rp_secpolicy_t));
+
+ if(secpolicy == NULL)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ secpolicy->binding = NULL;
+ secpolicy->wss = NULL;
+ secpolicy->supporting_tokens = NULL;
+ secpolicy->signed_supporting_tokens = NULL;
+ secpolicy->endorsing_supporting_tokens = NULL;
+ secpolicy->signed_endorsing_supporting_tokens = NULL;
+ secpolicy->signed_parts = NULL;
+ secpolicy->encrypted_parts = NULL;
+ secpolicy->signed_elements = NULL;
+ secpolicy->encrypted_elements = NULL;
+ secpolicy->signed_items = NULL;
+ secpolicy->encrypted_items = NULL;
+ secpolicy->rampart_config = NULL;
+
+ return secpolicy;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_secpolicy_free(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ if(secpolicy)
+ {
+ if(secpolicy->binding)
+ {
+ rp_property_free(secpolicy->binding,env);
+ secpolicy->binding = NULL;
+ }
+ if(secpolicy->wss)
+ {
+ rp_property_free(secpolicy->wss,env);
+ secpolicy->wss = NULL;
+ }
+ if(secpolicy->supporting_tokens)
+ {
+ rp_supporting_tokens_free(secpolicy->supporting_tokens,env);
+ secpolicy->supporting_tokens = NULL;
+ }
+ if(secpolicy->signed_supporting_tokens)
+ {
+ rp_supporting_tokens_free(secpolicy->signed_supporting_tokens,env);
+ secpolicy->signed_supporting_tokens = NULL;
+ }
+ if(secpolicy->endorsing_supporting_tokens)
+ {
+ rp_supporting_tokens_free(secpolicy->endorsing_supporting_tokens,env);
+ secpolicy->endorsing_supporting_tokens = NULL;
+ }
+ if(secpolicy->signed_endorsing_supporting_tokens)
+ {
+ rp_supporting_tokens_free(secpolicy->signed_endorsing_supporting_tokens,env);
+ secpolicy->signed_endorsing_supporting_tokens = NULL;
+ }
+ if(secpolicy->signed_parts)
+ {
+ rp_signed_encrypted_parts_free(secpolicy->signed_parts,env);
+ secpolicy->signed_parts = NULL;
+ }
+ if(secpolicy->encrypted_parts)
+ {
+ rp_signed_encrypted_parts_free(secpolicy->encrypted_parts,env);
+ secpolicy->encrypted_parts = NULL;
+ }
+ if(secpolicy->signed_elements)
+ {
+ rp_signed_encrypted_elements_free(secpolicy->signed_elements,env);
+ secpolicy->signed_elements = NULL;
+ }
+ if(secpolicy->encrypted_elements)
+ {
+ rp_signed_encrypted_elements_free(secpolicy->encrypted_elements,env);
+ secpolicy->encrypted_elements = NULL;
+ }
+ if(secpolicy->signed_items)
+ {
+ rp_signed_encrypted_items_free(secpolicy->signed_items,env);
+ secpolicy->signed_items = NULL;
+ }
+ if(secpolicy->encrypted_items)
+ {
+ rp_signed_encrypted_items_free(secpolicy->encrypted_items,env);
+ secpolicy->encrypted_items = NULL;
+ }
+ if(secpolicy->rampart_config)
+ {
+ rp_rampart_config_free(secpolicy->rampart_config,env);
+ secpolicy->rampart_config = NULL;
+ }
+ AXIS2_FREE(env->allocator,secpolicy);
+ }
+
+ return AXIS2_SUCCESS;
+}
+
+
+/* Implementations */
+AXIS2_EXTERN rp_property_t *AXIS2_CALL
+rp_secpolicy_get_binding(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return secpolicy->binding;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_secpolicy_set_binding(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env,
+ rp_property_t *binding)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,binding,AXIS2_FAILURE);
+
+ secpolicy->binding = binding;
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_secpolicy_set_supporting_tokens(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env,
+ rp_supporting_tokens_t *supporting_tokens)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,supporting_tokens,AXIS2_FAILURE);
+
+ secpolicy->supporting_tokens = supporting_tokens;
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN rp_supporting_tokens_t *AXIS2_CALL
+rp_secpolicy_get_supporting_tokens(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return secpolicy->supporting_tokens;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_secpolicy_set_signed_supporting_tokens(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env,
+ rp_supporting_tokens_t *signed_supporting_tokens)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,signed_supporting_tokens,AXIS2_FAILURE);
+
+ secpolicy->signed_supporting_tokens = signed_supporting_tokens;
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN rp_supporting_tokens_t *AXIS2_CALL
+rp_secpolicy_get_signed_supporting_tokens(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return secpolicy->signed_supporting_tokens;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_secpolicy_set_endorsing_supporting_tokens(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env,
+ rp_supporting_tokens_t *endorsing_supporting_tokens)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,endorsing_supporting_tokens,AXIS2_FAILURE);
+
+ secpolicy->endorsing_supporting_tokens = endorsing_supporting_tokens;
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN rp_supporting_tokens_t *AXIS2_CALL
+rp_secpolicy_get_endorsing_supporting_tokens(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return secpolicy->endorsing_supporting_tokens;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_secpolicy_set_signed_endorsing_supporting_tokens(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env,
+ rp_supporting_tokens_t *signed_endorsing_supporting_tokens)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,signed_endorsing_supporting_tokens,AXIS2_FAILURE);
+
+ secpolicy->signed_endorsing_supporting_tokens = signed_endorsing_supporting_tokens;
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN rp_supporting_tokens_t *AXIS2_CALL
+rp_secpolicy_get_signed_endorsing_supporting_tokens(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return secpolicy->signed_endorsing_supporting_tokens;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_secpolicy_set_signed_parts(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env,
+ rp_signed_encrypted_parts_t *signed_parts)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,signed_parts,AXIS2_FAILURE);
+ secpolicy->signed_parts = signed_parts;
+
+ return AXIS2_SUCCESS;
+
+}
+
+AXIS2_EXTERN rp_signed_encrypted_parts_t *AXIS2_CALL
+rp_secpolicy_get_signed_parts(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return secpolicy->signed_parts;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_secpolicy_set_encrypted_parts(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env,
+ rp_signed_encrypted_parts_t *encrypted_parts)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,encrypted_parts,AXIS2_FAILURE);
+
+ secpolicy->encrypted_parts = encrypted_parts;
+ return AXIS2_SUCCESS;
+
+}
+
+AXIS2_EXTERN rp_signed_encrypted_parts_t *AXIS2_CALL
+rp_secpolicy_get_encrypted_parts(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return secpolicy->encrypted_parts;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_secpolicy_set_signed_elements(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env,
+ rp_signed_encrypted_elements_t *signed_elements)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,signed_elements,AXIS2_FAILURE);
+
+ secpolicy->signed_elements = signed_elements;
+ return AXIS2_SUCCESS;
+
+}
+
+AXIS2_EXTERN rp_signed_encrypted_elements_t *AXIS2_CALL
+rp_secpolicy_get_signed_elements(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return secpolicy->signed_elements;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_secpolicy_set_encrypted_elements(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env,
+ rp_signed_encrypted_elements_t *encrypted_elements)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,encrypted_elements,AXIS2_FAILURE);
+
+ secpolicy->encrypted_elements = encrypted_elements;
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN rp_signed_encrypted_elements_t *AXIS2_CALL
+rp_secpolicy_get_encrypted_elements(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return secpolicy->encrypted_elements;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_secpolicy_set_signed_items(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env,
+ rp_signed_encrypted_items_t *signed_items)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,signed_items,AXIS2_FAILURE);
+
+ secpolicy->signed_items = signed_items;
+ return AXIS2_SUCCESS;
+
+}
+
+AXIS2_EXTERN rp_signed_encrypted_items_t *AXIS2_CALL
+rp_secpolicy_get_signed_items(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return secpolicy->signed_items;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_secpolicy_set_encrypted_items(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env,
+ rp_signed_encrypted_items_t *encrypted_items)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,encrypted_items,AXIS2_FAILURE);
+
+ secpolicy->encrypted_items = encrypted_items;
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN rp_signed_encrypted_items_t *AXIS2_CALL
+rp_secpolicy_get_encrypted_items(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return secpolicy->encrypted_items;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_secpolicy_set_wss(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env,
+ rp_property_t *wss)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,wss,AXIS2_FAILURE);
+
+ secpolicy->wss = wss;
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN rp_property_t *AXIS2_CALL
+rp_secpolicy_get_wss(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return secpolicy->wss;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_secpolicy_set_rampart_config(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env,
+ rp_rampart_config_t *rampart_config)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,rampart_config,AXIS2_FAILURE);
+
+ secpolicy->rampart_config = rampart_config;
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN rp_rampart_config_t *AXIS2_CALL
+rp_secpolicy_get_rampart_config(
+ rp_secpolicy_t *secpolicy,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return secpolicy->rampart_config;
+}
Added: webservices/rampart/tags/c/0.90/src/secpolicy/model/security_context_token.c
URL: http://svn.apache.org/viewvc/webservices/rampart/tags/c/0.90/src/secpolicy/model/security_context_token.c?rev=573215&view=auto
==============================================================================
--- webservices/rampart/tags/c/0.90/src/secpolicy/model/security_context_token.c (added)
+++ webservices/rampart/tags/c/0.90/src/secpolicy/model/security_context_token.c Thu Sep 6 03:48:44 2007
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#include <rp_security_context_token.h>
+
+struct rp_security_context_token_t
+{
+ axis2_char_t *inclusion;
+ axis2_bool_t derivedkeys;
+ axis2_bool_t require_external_uri_ref;
+ axis2_bool_t sc10_security_context_token;
+};
+
+AXIS2_EXTERN rp_security_context_token_t *AXIS2_CALL
+rp_security_context_token_create(const axutil_env_t *env)
+{
+ rp_security_context_token_t *security_context_token = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ security_context_token = (rp_security_context_token_t *) AXIS2_MALLOC (env->allocator,
+ sizeof (rp_security_context_token_t));
+
+ if(security_context_token == NULL)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ security_context_token->inclusion = RP_INCLUDE_ALWAYS;
+ security_context_token->derivedkeys = AXIS2_FALSE;
+ security_context_token->require_external_uri_ref = AXIS2_FALSE;
+ security_context_token->sc10_security_context_token = AXIS2_FALSE;
+
+ return security_context_token;
+
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_security_context_token_free(
+ rp_security_context_token_t *security_context_token,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ if(security_context_token)
+ {
+ AXIS2_FREE(env->allocator, security_context_token);
+ security_context_token = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+
+/* Implementations */
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_security_context_token_get_inclusion(
+ rp_security_context_token_t *security_context_token,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return security_context_token->inclusion;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_security_context_token_set_inclusion(
+ rp_security_context_token_t *security_context_token,
+ const axutil_env_t *env,
+ axis2_char_t *inclusion)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,inclusion,AXIS2_FAILURE);
+
+ security_context_token->inclusion = inclusion;
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_security_context_token_get_derivedkeys(
+ rp_security_context_token_t *security_context_token,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return security_context_token->derivedkeys;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_security_context_token_set_derivedkeys(
+ rp_security_context_token_t *security_context_token,
+ const axutil_env_t *env,
+ axis2_bool_t derivedkeys)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,derivedkeys,AXIS2_FAILURE);
+
+ security_context_token->derivedkeys = derivedkeys;
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_security_context_token_get_require_external_uri_ref(
+ rp_security_context_token_t *security_context_token,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return security_context_token->require_external_uri_ref;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_security_context_token_set_require_external_uri_ref(
+ rp_security_context_token_t *security_context_token,
+ const axutil_env_t *env,
+ axis2_bool_t require_external_uri_ref)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,require_external_uri_ref,AXIS2_FAILURE);
+
+ security_context_token->require_external_uri_ref =
+ require_external_uri_ref;
+
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_security_context_token_get_sc10_security_context_token(
+ rp_security_context_token_t *security_context_token,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return security_context_token->require_external_uri_ref;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_security_context_token_set_sc10_security_context_token(
+ rp_security_context_token_t *security_context_token,
+ const axutil_env_t *env,
+ axis2_bool_t sc10_security_context_token)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,sc10_security_context_token,AXIS2_FAILURE);
+
+ security_context_token->sc10_security_context_token =
+ sc10_security_context_token;
+
+ return AXIS2_SUCCESS;
+}
Added: webservices/rampart/tags/c/0.90/src/secpolicy/model/signed_encrypted_elements.c
URL: http://svn.apache.org/viewvc/webservices/rampart/tags/c/0.90/src/secpolicy/model/signed_encrypted_elements.c?rev=573215&view=auto
==============================================================================
--- webservices/rampart/tags/c/0.90/src/secpolicy/model/signed_encrypted_elements.c (added)
+++ webservices/rampart/tags/c/0.90/src/secpolicy/model/signed_encrypted_elements.c Thu Sep 6 03:48:44 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_signed_encrypted_elements.h>
+
+struct rp_signed_encrypted_elements_t
+{
+ axis2_bool_t signedelements;
+ axutil_array_list_t *xpath_expressions;
+ axis2_char_t *xpath_version;
+
+};
+
+AXIS2_EXTERN rp_signed_encrypted_elements_t *AXIS2_CALL
+rp_signed_encrypted_elements_create(const axutil_env_t *env)
+{
+ rp_signed_encrypted_elements_t *signed_encrypted_elements = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ signed_encrypted_elements = (rp_signed_encrypted_elements_t *) AXIS2_MALLOC (env->allocator,
+ sizeof (rp_signed_encrypted_elements_t));
+
+ if(signed_encrypted_elements == NULL)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ signed_encrypted_elements->xpath_expressions = NULL;
+
+ signed_encrypted_elements->xpath_expressions = axutil_array_list_create(env, 0);
+ if (!(signed_encrypted_elements->xpath_expressions))
+ {
+ rp_signed_encrypted_elements_free(signed_encrypted_elements, env);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ signed_encrypted_elements->xpath_version = NULL;
+
+ return signed_encrypted_elements;
+
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_signed_encrypted_elements_free(rp_signed_encrypted_elements_t *signed_encrypted_elements,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ if(signed_encrypted_elements)
+ {
+
+ if(signed_encrypted_elements->xpath_expressions)
+ {
+ int i = 0;
+ for (i = 0; i < axutil_array_list_size(signed_encrypted_elements->xpath_expressions,
+ env); i++)
+ {
+ axis2_char_t *expression = NULL;
+ expression = (axis2_char_t *)
+ axutil_array_list_get(signed_encrypted_elements->xpath_expressions,env, i);
+ if (expression)
+ AXIS2_FREE(env->allocator,expression);
+
+ expression = NULL;
+ }
+ axutil_array_list_free(signed_encrypted_elements->xpath_expressions, env);
+ signed_encrypted_elements->xpath_expressions = NULL;
+
+ }
+ AXIS2_FREE(env->allocator,signed_encrypted_elements);
+ signed_encrypted_elements = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+
+/* Implementations */
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_signed_encrypted_elements_get_signedelements(rp_signed_encrypted_elements_t *signed_encrypted_elements,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return signed_encrypted_elements->signedelements;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_signed_encrypted_elements_set_signedelements(rp_signed_encrypted_elements_t *signed_encrypted_elements,
+ const axutil_env_t *env,
+ axis2_bool_t signedelements)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,signedelements,AXIS2_FAILURE);
+
+ signed_encrypted_elements->signedelements = signedelements;
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL
+rp_signed_encrypted_elements_get_xpath_expressions(
+ rp_signed_encrypted_elements_t *signed_encrypted_elements,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return signed_encrypted_elements->xpath_expressions;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_signed_encrypted_elements_add_expression(rp_signed_encrypted_elements_t *signed_encrypted_elements,
+ const axutil_env_t *env,
+ axis2_char_t *expression)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,expression,AXIS2_FAILURE);
+
+ axutil_array_list_add(signed_encrypted_elements->xpath_expressions,env,expression);
+ return AXIS2_SUCCESS;
+}
+
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_signed_encrypted_elements_get_xpath_version(rp_signed_encrypted_elements_t *signed_encrypted_elements,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return signed_encrypted_elements->xpath_version;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_signed_encrypted_elements_set_xpath_version(rp_signed_encrypted_elements_t *signed_encrypted_elements,
+ const axutil_env_t *env,
+ axis2_char_t *xpath_version)
+{
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,xpath_version,AXIS2_FAILURE);
+
+ signed_encrypted_elements->xpath_version = xpath_version;
+ return AXIS2_SUCCESS;
+}
Added: webservices/rampart/tags/c/0.90/src/secpolicy/model/signed_encrypted_items.c
URL: http://svn.apache.org/viewvc/webservices/rampart/tags/c/0.90/src/secpolicy/model/signed_encrypted_items.c?rev=573215&view=auto
==============================================================================
--- webservices/rampart/tags/c/0.90/src/secpolicy/model/signed_encrypted_items.c (added)
+++ webservices/rampart/tags/c/0.90/src/secpolicy/model/signed_encrypted_items.c Thu Sep 6 03:48:44 2007
@@ -0,0 +1,136 @@
+/*
+ * 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_signed_encrypted_items.h>
+
+struct rp_signed_encrypted_items_t
+{
+ axis2_bool_t signeditems;
+ axutil_array_list_t *elements;
+
+};
+
+AXIS2_EXTERN rp_signed_encrypted_items_t *AXIS2_CALL
+rp_signed_encrypted_items_create(const axutil_env_t *env)
+{
+ rp_signed_encrypted_items_t *signed_encrypted_items = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ signed_encrypted_items = (rp_signed_encrypted_items_t *) AXIS2_MALLOC (env->allocator,
+ sizeof (rp_signed_encrypted_items_t));
+
+ if(signed_encrypted_items == NULL)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ signed_encrypted_items->elements = NULL;
+
+ signed_encrypted_items->elements = axutil_array_list_create(env, 0);
+ if (!(signed_encrypted_items->elements) )
+ {
+ rp_signed_encrypted_items_free(signed_encrypted_items, env);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ return signed_encrypted_items;
+
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_signed_encrypted_items_free(rp_signed_encrypted_items_t *signed_encrypted_items,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ if(signed_encrypted_items)
+ {
+
+ if(signed_encrypted_items->elements)
+ {
+ int i = 0;
+ for (i = 0; i < axutil_array_list_size(signed_encrypted_items->elements,
+ env); i++)
+ {
+ rp_element_t *element = NULL;
+ element = (rp_element_t *)
+ axutil_array_list_get(signed_encrypted_items->elements,env, i);
+ if (element)
+ rp_element_free(element, env);
+
+ element = NULL;
+ }
+ axutil_array_list_free(signed_encrypted_items->elements, env);
+ signed_encrypted_items->elements = NULL;
+
+ }
+ AXIS2_FREE(env->allocator,signed_encrypted_items);
+ signed_encrypted_items = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+
+/* Implementations */
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_signed_encrypted_items_get_signeditems(rp_signed_encrypted_items_t *signed_encrypted_items,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return signed_encrypted_items->signeditems;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_signed_encrypted_items_set_signeditems(rp_signed_encrypted_items_t *signed_encrypted_items,
+ const axutil_env_t *env,
+ axis2_bool_t signeditems)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,signeditems,AXIS2_FAILURE);
+ signed_encrypted_items->signeditems = signeditems;
+
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL
+rp_signed_encrypted_items_get_elements(
+ rp_signed_encrypted_items_t *signed_encrypted_items,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return signed_encrypted_items->elements;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_signed_encrypted_items_add_element(rp_signed_encrypted_items_t *signed_encrypted_items,
+ const axutil_env_t *env,
+ rp_element_t *element)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,element,AXIS2_FAILURE);
+
+ axutil_array_list_add(signed_encrypted_items->elements,env,element);
+ return AXIS2_SUCCESS;
+}
+
Added: webservices/rampart/tags/c/0.90/src/secpolicy/model/signed_encrypted_parts.c
URL: http://svn.apache.org/viewvc/webservices/rampart/tags/c/0.90/src/secpolicy/model/signed_encrypted_parts.c?rev=573215&view=auto
==============================================================================
--- webservices/rampart/tags/c/0.90/src/secpolicy/model/signed_encrypted_parts.c (added)
+++ webservices/rampart/tags/c/0.90/src/secpolicy/model/signed_encrypted_parts.c Thu Sep 6 03:48:44 2007
@@ -0,0 +1,158 @@
+/*
+ * 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_signed_encrypted_parts.h>
+
+struct rp_signed_encrypted_parts_t
+{
+ axis2_bool_t body;
+ axis2_bool_t signedparts;
+ axutil_array_list_t *headers;
+
+};
+
+AXIS2_EXTERN rp_signed_encrypted_parts_t *AXIS2_CALL
+rp_signed_encrypted_parts_create(const axutil_env_t *env)
+{
+ rp_signed_encrypted_parts_t *signed_encrypted_parts = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ signed_encrypted_parts = (rp_signed_encrypted_parts_t *) AXIS2_MALLOC (env->allocator,
+ sizeof (rp_signed_encrypted_parts_t));
+
+ if(signed_encrypted_parts == NULL)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ signed_encrypted_parts->headers = NULL;
+
+ signed_encrypted_parts->headers = axutil_array_list_create(env, 0);
+ if (!(signed_encrypted_parts->headers) )
+ {
+ rp_signed_encrypted_parts_free(signed_encrypted_parts, env);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ return signed_encrypted_parts;
+
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_signed_encrypted_parts_free(rp_signed_encrypted_parts_t *signed_encrypted_parts,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ if(signed_encrypted_parts)
+ {
+
+ if(signed_encrypted_parts->headers)
+ {
+ int i = 0;
+ for (i = 0; i < axutil_array_list_size(signed_encrypted_parts->headers,
+ env); i++)
+ {
+ rp_header_t *header = NULL;
+ header = (rp_header_t *)
+ axutil_array_list_get(signed_encrypted_parts->headers,env, i);
+ if (header)
+ rp_header_free(header, env);
+
+ header = NULL;
+ }
+ axutil_array_list_free(signed_encrypted_parts->headers, env);
+ signed_encrypted_parts->headers = NULL;
+
+ }
+ AXIS2_FREE(env->allocator,signed_encrypted_parts);
+ signed_encrypted_parts = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+
+/* Implementations */
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_signed_encrypted_parts_get_body(rp_signed_encrypted_parts_t *signed_encrypted_parts,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return signed_encrypted_parts->body;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_signed_encrypted_parts_set_body(rp_signed_encrypted_parts_t *signed_encrypted_parts,
+ const axutil_env_t *env,
+ axis2_bool_t body)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,body,AXIS2_FAILURE);
+ signed_encrypted_parts->body = body;
+
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_signed_encrypted_parts_get_signedparts(rp_signed_encrypted_parts_t *signed_encrypted_parts,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return signed_encrypted_parts->signedparts;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_signed_encrypted_parts_set_signedparts(rp_signed_encrypted_parts_t *signed_encrypted_parts,
+ const axutil_env_t *env,
+ axis2_bool_t signedparts)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,signedparts,AXIS2_FAILURE);
+ signed_encrypted_parts->signedparts = signedparts;
+
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL
+rp_signed_encrypted_parts_get_headers(
+ rp_signed_encrypted_parts_t *signed_encrypted_parts,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return signed_encrypted_parts->headers;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_signed_encrypted_parts_add_header(rp_signed_encrypted_parts_t *signed_encrypted_parts,
+ const axutil_env_t *env,
+ rp_header_t *header)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,header,AXIS2_FAILURE);
+
+ axutil_array_list_add(signed_encrypted_parts->headers,env,header);
+ return AXIS2_SUCCESS;
+}
+
Added: webservices/rampart/tags/c/0.90/src/secpolicy/model/supporting_tokens.c
URL: http://svn.apache.org/viewvc/webservices/rampart/tags/c/0.90/src/secpolicy/model/supporting_tokens.c?rev=573215&view=auto
==============================================================================
--- webservices/rampart/tags/c/0.90/src/secpolicy/model/supporting_tokens.c (added)
+++ webservices/rampart/tags/c/0.90/src/secpolicy/model/supporting_tokens.c Thu Sep 6 03:48:44 2007
@@ -0,0 +1,280 @@
+/*
+ * 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.h>
+
+struct rp_supporting_tokens_t
+{
+ rp_algorithmsuite_t *algorithmsuite;
+ axutil_array_list_t *tokens;
+ rp_signed_encrypted_elements_t *signed_elements;
+ rp_signed_encrypted_parts_t *signed_parts;
+ rp_signed_encrypted_elements_t *encrypted_elements;
+ rp_signed_encrypted_parts_t *encrypted_parts;
+ int type;
+};
+
+AXIS2_EXTERN rp_supporting_tokens_t *AXIS2_CALL
+rp_supporting_tokens_create(const axutil_env_t *env)
+{
+ rp_supporting_tokens_t *supporting_tokens = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ supporting_tokens = (rp_supporting_tokens_t *) AXIS2_MALLOC (env->allocator,
+ sizeof (rp_supporting_tokens_t));
+
+ if(supporting_tokens == NULL)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ supporting_tokens->tokens = NULL;
+ supporting_tokens->tokens = axutil_array_list_create(env,0);
+ if (!(supporting_tokens->tokens))
+ {
+ rp_supporting_tokens_free(supporting_tokens, env);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ supporting_tokens->algorithmsuite = NULL;
+ supporting_tokens->signed_parts = NULL;
+ supporting_tokens->signed_elements = NULL;
+ supporting_tokens->encrypted_parts = NULL;
+ supporting_tokens->encrypted_elements = NULL;
+ supporting_tokens->type = 0;
+ return supporting_tokens;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_supporting_tokens_free(rp_supporting_tokens_t *supporting_tokens,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ if(supporting_tokens)
+ {
+
+ if(supporting_tokens->tokens)
+ {
+ int i = 0;
+ for (i = 0; i < axutil_array_list_size(supporting_tokens->tokens,
+ env); i++)
+ {
+ rp_property_t *token = NULL;
+ token = (rp_property_t *)
+ axutil_array_list_get(supporting_tokens->tokens,env, i);
+ if (token)
+ rp_property_free(token, env);
+
+ token = NULL;
+ }
+ axutil_array_list_free(supporting_tokens->tokens, env);
+ supporting_tokens->tokens = NULL;
+
+ }
+ if(supporting_tokens->algorithmsuite)
+ {
+ rp_algorithmsuite_free(supporting_tokens->algorithmsuite,env);
+ supporting_tokens->algorithmsuite = NULL;
+ }
+ if(supporting_tokens->signed_parts)
+ {
+ rp_signed_encrypted_parts_free(supporting_tokens->signed_parts,env);
+ supporting_tokens->signed_parts = NULL;
+ }
+ if(supporting_tokens->signed_elements)
+ {
+ rp_signed_encrypted_elements_free(supporting_tokens->signed_elements,env);
+ supporting_tokens->signed_elements = NULL;
+ }
+ if(supporting_tokens->encrypted_parts)
+ {
+ rp_signed_encrypted_parts_free(supporting_tokens->encrypted_parts,env);
+ supporting_tokens->encrypted_parts = NULL;
+ }
+ if(supporting_tokens->encrypted_elements)
+ {
+ rp_signed_encrypted_elements_free(supporting_tokens->encrypted_elements,env);
+ supporting_tokens->encrypted_elements = NULL;
+ }
+ AXIS2_FREE(env->allocator,supporting_tokens);
+ supporting_tokens = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+
+/* Implementations */
+
+AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL
+rp_supporting_tokens_get_tokens(
+ rp_supporting_tokens_t *supporting_tokens,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return supporting_tokens->tokens;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_supporting_tokens_add_token(rp_supporting_tokens_t *supporting_tokens,
+ const axutil_env_t *env,
+ rp_property_t *token)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,token,AXIS2_FAILURE);
+
+ axutil_array_list_add(supporting_tokens->tokens,env,token);
+ return AXIS2_SUCCESS;
+}
+
+
+
+AXIS2_EXTERN rp_algorithmsuite_t *AXIS2_CALL
+rp_supporting_tokens_get_algorithmsuite(
+ rp_supporting_tokens_t *supporting_tokens,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+
+ return supporting_tokens->algorithmsuite;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_supporting_tokens_set_algorithmsuite(rp_supporting_tokens_t *supporting_tokens,
+ const axutil_env_t *env,
+ rp_algorithmsuite_t *algorithmsuite)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,algorithmsuite,AXIS2_FAILURE);
+
+ supporting_tokens->algorithmsuite = algorithmsuite;
+ return AXIS2_SUCCESS;
+}
+
+
+AXIS2_EXTERN rp_signed_encrypted_parts_t *AXIS2_CALL
+rp_supporting_tokens_get_signed_parts(
+ rp_supporting_tokens_t *supporting_tokens,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+
+ return supporting_tokens->signed_parts;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_supporting_tokens_set_signed_parts(rp_supporting_tokens_t *supporting_tokens,
+ const axutil_env_t *env,
+ rp_signed_encrypted_parts_t *signed_parts)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,signed_parts,AXIS2_FAILURE);
+
+ supporting_tokens->signed_parts = signed_parts;
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN rp_signed_encrypted_elements_t *AXIS2_CALL
+rp_supporting_tokens_get_signed_elements(
+ rp_supporting_tokens_t *supporting_tokens,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+
+ return supporting_tokens->signed_elements;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_supporting_tokens_set_signed_elements(rp_supporting_tokens_t *supporting_tokens,
+ const axutil_env_t *env,
+ rp_signed_encrypted_elements_t *signed_elements)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,signed_elements,AXIS2_FAILURE);
+
+ supporting_tokens->signed_elements = signed_elements;
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN rp_signed_encrypted_parts_t *AXIS2_CALL
+rp_supporting_tokens_get_encrypted_parts(
+ rp_supporting_tokens_t *supporting_tokens,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+
+ return supporting_tokens->encrypted_parts;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_supporting_tokens_set_encrypted_parts(rp_supporting_tokens_t *supporting_tokens,
+ const axutil_env_t *env,
+ rp_signed_encrypted_parts_t *encrypted_parts)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,encrypted_parts,AXIS2_FAILURE);
+
+ supporting_tokens->encrypted_parts = encrypted_parts;
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN rp_signed_encrypted_elements_t *AXIS2_CALL
+rp_supporting_tokens_get_encrypted_elements(
+ rp_supporting_tokens_t *supporting_tokens,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return supporting_tokens->encrypted_elements;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_supporting_tokens_set_encrypted_elements(rp_supporting_tokens_t *supporting_tokens,
+ const axutil_env_t *env,
+ rp_signed_encrypted_elements_t *encrypted_elements)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,encrypted_elements,AXIS2_FAILURE);
+
+ supporting_tokens->encrypted_elements = encrypted_elements;
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN int AXIS2_CALL
+rp_supporting_tokens_get_type(
+ rp_supporting_tokens_t *supporting_tokens,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ return supporting_tokens->type;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_supporting_tokens_set_type(rp_supporting_tokens_t *supporting_tokens,
+ const axutil_env_t *env,
+ int type)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ supporting_tokens->type = type;
+ return AXIS2_SUCCESS;
+}
Added: webservices/rampart/tags/c/0.90/src/secpolicy/model/symmetric_asymmetric_binding_commons.c
URL: http://svn.apache.org/viewvc/webservices/rampart/tags/c/0.90/src/secpolicy/model/symmetric_asymmetric_binding_commons.c?rev=573215&view=auto
==============================================================================
--- webservices/rampart/tags/c/0.90/src/secpolicy/model/symmetric_asymmetric_binding_commons.c (added)
+++ webservices/rampart/tags/c/0.90/src/secpolicy/model/symmetric_asymmetric_binding_commons.c Thu Sep 6 03:48:44 2007
@@ -0,0 +1,196 @@
+/*
+ * 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_binding_commons.h>
+
+struct rp_symmetric_asymmetric_binding_commons_t
+{
+ rp_binding_commons_t *binding_commons;
+ axis2_char_t *protection_order;
+ axis2_bool_t signature_protection;
+ axis2_bool_t token_protection;
+ axis2_bool_t entire_headers_and_body_signatures;
+
+};
+
+AXIS2_EXTERN rp_symmetric_asymmetric_binding_commons_t *AXIS2_CALL
+rp_symmetric_asymmetric_binding_commons_create(const axutil_env_t *env)
+{
+ rp_symmetric_asymmetric_binding_commons_t *symmetric_asymmetric_binding_commons = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ symmetric_asymmetric_binding_commons = (rp_symmetric_asymmetric_binding_commons_t *)
+ AXIS2_MALLOC (env->allocator,sizeof (rp_symmetric_asymmetric_binding_commons_t));
+
+ if(symmetric_asymmetric_binding_commons == NULL)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ symmetric_asymmetric_binding_commons->binding_commons = NULL;
+ symmetric_asymmetric_binding_commons->protection_order = RP_SIGN_BEFORE_ENCRYPTING;
+ symmetric_asymmetric_binding_commons->signature_protection = AXIS2_FALSE;
+ symmetric_asymmetric_binding_commons->token_protection = AXIS2_FALSE;
+ symmetric_asymmetric_binding_commons->entire_headers_and_body_signatures = AXIS2_FALSE;
+
+ return symmetric_asymmetric_binding_commons;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_symmetric_asymmetric_binding_commons_free(
+ rp_symmetric_asymmetric_binding_commons_t *symmetric_asymmetric_binding_commons,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ if(symmetric_asymmetric_binding_commons)
+ {
+ if(symmetric_asymmetric_binding_commons->binding_commons)
+ {
+ rp_binding_commons_free(symmetric_asymmetric_binding_commons->binding_commons,env);
+ symmetric_asymmetric_binding_commons->binding_commons = NULL;
+ }
+ AXIS2_FREE(env->allocator,symmetric_asymmetric_binding_commons);
+ symmetric_asymmetric_binding_commons = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+
+/* Implementations */
+AXIS2_EXTERN rp_binding_commons_t *AXIS2_CALL
+rp_symmetric_asymmetric_binding_commons_get_binding_commons(
+ rp_symmetric_asymmetric_binding_commons_t *symmetric_asymmetric_binding_commons,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+
+ return symmetric_asymmetric_binding_commons->binding_commons;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_symmetric_asymmetric_binding_commons_set_binding_commons(
+ rp_symmetric_asymmetric_binding_commons_t *symmetric_asymmetric_binding_commons,
+ const axutil_env_t *env,
+ rp_binding_commons_t *binding_commons)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,binding_commons,AXIS2_FAILURE);
+
+ symmetric_asymmetric_binding_commons->binding_commons=binding_commons;
+ return AXIS2_SUCCESS;
+}
+
+
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_symmetric_asymmetric_binding_commons_get_signature_protection(
+ rp_symmetric_asymmetric_binding_commons_t *symmetric_asymmetric_binding_commons,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FALSE);
+
+ return symmetric_asymmetric_binding_commons->signature_protection;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_symmetric_asymmetric_binding_commons_set_signature_protection(
+ rp_symmetric_asymmetric_binding_commons_t *symmetric_asymmetric_binding_commons,
+ const axutil_env_t *env,
+ axis2_bool_t signature_protection)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,signature_protection,AXIS2_FAILURE);
+ symmetric_asymmetric_binding_commons->signature_protection = signature_protection;
+
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_symmetric_asymmetric_binding_commons_get_token_protection(
+ rp_symmetric_asymmetric_binding_commons_t *symmetric_asymmetric_binding_commons,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FALSE);
+
+ return symmetric_asymmetric_binding_commons->token_protection;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_symmetric_asymmetric_binding_commons_set_token_protection(
+ rp_symmetric_asymmetric_binding_commons_t *symmetric_asymmetric_binding_commons,
+ const axutil_env_t *env,
+ axis2_bool_t token_protection)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,token_protection,AXIS2_FAILURE);
+
+ symmetric_asymmetric_binding_commons->token_protection = token_protection;
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_symmetric_asymmetric_binding_commons_get_entire_headers_and_body_signatures(
+ rp_symmetric_asymmetric_binding_commons_t *symmetric_asymmetric_binding_commons,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FALSE);
+
+ return symmetric_asymmetric_binding_commons->entire_headers_and_body_signatures;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_symmetric_asymmetric_binding_commons_set_entire_headers_and_body_signatures(
+ rp_symmetric_asymmetric_binding_commons_t *symmetric_asymmetric_binding_commons,
+ const axutil_env_t *env,
+ axis2_bool_t entire_headers_and_body_signatures)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,entire_headers_and_body_signatures,AXIS2_FAILURE);
+
+ symmetric_asymmetric_binding_commons->entire_headers_and_body_signatures =
+ entire_headers_and_body_signatures;
+
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_symmetric_asymmetric_binding_commons_get_protection_order(
+ rp_symmetric_asymmetric_binding_commons_t *symmetric_asymmetric_binding_commons,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+
+ return symmetric_asymmetric_binding_commons->protection_order;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_symmetric_asymmetric_binding_commons_set_protection_order(
+ rp_symmetric_asymmetric_binding_commons_t *symmetric_asymmetric_binding_commons,
+ const axutil_env_t *env,
+ axis2_char_t *protection_order)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,protection_order,AXIS2_FAILURE);
+
+ symmetric_asymmetric_binding_commons->protection_order = protection_order;
+ return AXIS2_SUCCESS;
+}
+
Added: webservices/rampart/tags/c/0.90/src/secpolicy/model/symmetric_binding.c
URL: http://svn.apache.org/viewvc/webservices/rampart/tags/c/0.90/src/secpolicy/model/symmetric_binding.c?rev=573215&view=auto
==============================================================================
--- webservices/rampart/tags/c/0.90/src/secpolicy/model/symmetric_binding.c (added)
+++ webservices/rampart/tags/c/0.90/src/secpolicy/model/symmetric_binding.c Thu Sep 6 03:48:44 2007
@@ -0,0 +1,205 @@
+/*
+ * 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.h>
+
+struct rp_symmetric_binding_t
+{
+ rp_symmetric_asymmetric_binding_commons_t *symmetric_asymmetric_binding_commons;
+ rp_property_t *protection_token;
+ rp_property_t *signature_token;
+ rp_property_t *encryption_token;
+};
+
+AXIS2_EXTERN rp_symmetric_binding_t *AXIS2_CALL
+rp_symmetric_binding_create(const axutil_env_t *env)
+{
+ rp_symmetric_binding_t *symmetric_binding = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ symmetric_binding = (rp_symmetric_binding_t *) AXIS2_MALLOC (env->allocator,
+ sizeof (rp_symmetric_binding_t));
+
+ if(symmetric_binding == NULL)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ symmetric_binding->symmetric_asymmetric_binding_commons = NULL;
+ symmetric_binding->protection_token = NULL;
+ symmetric_binding->signature_token = NULL;
+ symmetric_binding->encryption_token = NULL;
+
+ return symmetric_binding;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_symmetric_binding_free(
+ rp_symmetric_binding_t *symmetric_binding,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ if(symmetric_binding)
+ {
+ if(symmetric_binding->symmetric_asymmetric_binding_commons)
+ {
+ rp_symmetric_asymmetric_binding_commons_free(
+ symmetric_binding->symmetric_asymmetric_binding_commons,
+ env);
+ symmetric_binding->symmetric_asymmetric_binding_commons=NULL;
+ }
+ if(symmetric_binding->protection_token)
+ {
+ rp_property_free(symmetric_binding->protection_token,env);
+ symmetric_binding->protection_token = NULL;
+ }
+ if(symmetric_binding->encryption_token)
+ {
+ rp_property_free(symmetric_binding->encryption_token,env);
+ symmetric_binding->encryption_token = NULL;
+ }
+ if(symmetric_binding->signature_token)
+ {
+ rp_property_free(symmetric_binding->signature_token,env);
+ symmetric_binding->signature_token = NULL;
+ }
+ AXIS2_FREE(env->allocator,symmetric_binding);
+ }
+
+ return AXIS2_SUCCESS;
+}
+
+
+/* Implementations */
+
+AXIS2_EXTERN rp_symmetric_asymmetric_binding_commons_t *AXIS2_CALL
+rp_symmetric_binding_get_symmetric_asymmetric_binding_commons(
+ rp_symmetric_binding_t *symmetric_binding,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+
+ return symmetric_binding->symmetric_asymmetric_binding_commons;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_symmetric_binding_set_symmetric_asymmetric_binding_commons(
+ rp_symmetric_binding_t *symmetric_binding,
+ const axutil_env_t *env,
+ rp_symmetric_asymmetric_binding_commons_t *symmetric_asymmetric_binding_commons)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,symmetric_asymmetric_binding_commons,AXIS2_FAILURE);
+
+ symmetric_binding->symmetric_asymmetric_binding_commons
+ =symmetric_asymmetric_binding_commons;
+
+ return AXIS2_SUCCESS;
+}
+
+
+
+AXIS2_EXTERN rp_property_t *AXIS2_CALL
+rp_symmetric_binding_get_protection_token(
+ rp_symmetric_binding_t *symmetric_binding,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+
+ return symmetric_binding->protection_token;
+}
+
+
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_symmetric_binding_set_protection_token(
+ rp_symmetric_binding_t *symmetric_binding,
+ const axutil_env_t *env,
+ rp_property_t *protection_token)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,protection_token,AXIS2_FAILURE);
+ if(symmetric_binding->signature_token ||
+ symmetric_binding->encryption_token)
+ {
+ return AXIS2_FAILURE;
+ }
+ symmetric_binding->protection_token=protection_token;
+
+ return AXIS2_SUCCESS;
+
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_symmetric_binding_set_encryption_token(
+ rp_symmetric_binding_t *symmetric_binding,
+ const axutil_env_t *env,
+ rp_property_t *encryption_token)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,encryption_token,AXIS2_FAILURE);
+ if(symmetric_binding->protection_token)
+ {
+ return AXIS2_FAILURE;
+ }
+ symmetric_binding->encryption_token = encryption_token;
+
+ return AXIS2_SUCCESS;
+
+}
+
+AXIS2_EXTERN rp_property_t *AXIS2_CALL
+rp_symmetric_binding_get_encryption_token(
+ rp_symmetric_binding_t *symmetric_binding,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+
+ return symmetric_binding->encryption_token;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_symmetric_binding_set_signature_token(
+ rp_symmetric_binding_t *symmetric_binding,
+ const axutil_env_t *env,
+ rp_property_t *signature_token)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,signature_token,AXIS2_FAILURE);
+ if(symmetric_binding->protection_token)
+ {
+ return AXIS2_FAILURE;
+ }
+ symmetric_binding->signature_token = signature_token;
+
+ return AXIS2_SUCCESS;
+
+}
+
+AXIS2_EXTERN rp_property_t *AXIS2_CALL
+rp_symmetric_binding_get_signature_token(
+ rp_symmetric_binding_t *symmetric_binding,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+
+ return symmetric_binding->signature_token;
+}
Added: webservices/rampart/tags/c/0.90/src/secpolicy/model/transport_binding.c
URL: http://svn.apache.org/viewvc/webservices/rampart/tags/c/0.90/src/secpolicy/model/transport_binding.c?rev=573215&view=auto
==============================================================================
--- webservices/rampart/tags/c/0.90/src/secpolicy/model/transport_binding.c (added)
+++ webservices/rampart/tags/c/0.90/src/secpolicy/model/transport_binding.c Thu Sep 6 03:48:44 2007
@@ -0,0 +1,124 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#include <rp_transport_binding.h>
+
+struct rp_transport_binding_t
+{
+ rp_binding_commons_t *binding_commons;
+ rp_property_t *transport_token;
+};
+
+AXIS2_EXTERN rp_transport_binding_t *AXIS2_CALL
+rp_transport_binding_create(const axutil_env_t *env)
+{
+ rp_transport_binding_t *transport_binding = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ transport_binding = (rp_transport_binding_t *) AXIS2_MALLOC (env->allocator,
+ sizeof (rp_transport_binding_t));
+
+ if(transport_binding == NULL)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ transport_binding->binding_commons = NULL;
+ transport_binding->transport_token = NULL;
+
+ return transport_binding;
+
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_transport_binding_free(
+ rp_transport_binding_t *transport_binding,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ if(transport_binding)
+ {
+ if(transport_binding->binding_commons)
+ {
+ rp_binding_commons_free(transport_binding->binding_commons,env);
+ transport_binding->binding_commons=NULL;
+ }
+ if(transport_binding->transport_token)
+ {
+ rp_property_free(transport_binding->transport_token,env);
+ transport_binding->transport_token = NULL;
+ }
+ AXIS2_FREE(env->allocator,transport_binding);
+ }
+
+ return AXIS2_SUCCESS;
+}
+
+
+/* Implementations */
+
+AXIS2_EXTERN rp_binding_commons_t *AXIS2_CALL
+rp_transport_binding_get_binding_commons(
+ rp_transport_binding_t *transport_binding,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+
+ return transport_binding->binding_commons;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_transport_binding_set_binding_commons(
+ rp_transport_binding_t *transport_binding,
+ const axutil_env_t *env,
+ rp_binding_commons_t *binding_commons)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,binding_commons,AXIS2_FAILURE);
+
+ transport_binding->binding_commons=binding_commons;
+ return AXIS2_SUCCESS;
+}
+
+
+AXIS2_EXTERN rp_property_t *AXIS2_CALL
+rp_transport_binding_get_transport_token(
+ rp_transport_binding_t *transport_binding,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+
+ return transport_binding->transport_token;
+}
+
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_transport_binding_set_transport_token(
+ rp_transport_binding_t *transport_binding,
+ const axutil_env_t *env,
+ rp_property_t *transport_token)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,transport_token,AXIS2_FAILURE);
+
+ transport_binding->transport_token = transport_token;
+ return AXIS2_SUCCESS;
+}
Added: webservices/rampart/tags/c/0.90/src/secpolicy/model/ut.c
URL: http://svn.apache.org/viewvc/webservices/rampart/tags/c/0.90/src/secpolicy/model/ut.c?rev=573215&view=auto
==============================================================================
--- webservices/rampart/tags/c/0.90/src/secpolicy/model/ut.c (added)
+++ webservices/rampart/tags/c/0.90/src/secpolicy/model/ut.c Thu Sep 6 03:48:44 2007
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#include <rp_username_token.h>
+
+struct rp_username_token_t
+{
+ axis2_char_t *inclusion;
+ axis2_bool_t derivedkeys;
+ axis2_bool_t useUTprofile10;
+ axis2_bool_t useUTprofile11;
+};
+
+AXIS2_EXTERN rp_username_token_t *AXIS2_CALL
+rp_username_token_create(const axutil_env_t *env)
+{
+ rp_username_token_t *username_token = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ username_token = (rp_username_token_t *) AXIS2_MALLOC (env->allocator,
+ sizeof (rp_username_token_t));
+
+ if(username_token == NULL)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ username_token->inclusion = RP_INCLUDE_ALWAYS;
+ username_token->derivedkeys = AXIS2_FALSE;
+ username_token->useUTprofile10 = AXIS2_TRUE;
+ username_token->useUTprofile11 = AXIS2_FALSE;
+
+ return username_token;
+
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_username_token_free(
+ rp_username_token_t *username_token,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ if(username_token)
+ {
+ AXIS2_FREE(env->allocator, username_token);
+ username_token = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+
+/* Implementations */
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_username_token_get_inclusion(
+ rp_username_token_t *username_token,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+
+ return username_token->inclusion;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_username_token_set_inclusion(
+ rp_username_token_t *username_token,
+ const axutil_env_t *env,
+ axis2_char_t *inclusion)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,inclusion,AXIS2_FAILURE);
+
+ username_token->inclusion = inclusion;
+
+ return AXIS2_SUCCESS;
+}
+
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_username_token_get_derivedkeys(
+ rp_username_token_t *username_token,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FALSE);
+
+ return username_token->derivedkeys;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_username_token_set_derivedkeys(
+ rp_username_token_t *username_token,
+ const axutil_env_t *env,
+ axis2_bool_t derivedkeys)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,derivedkeys,AXIS2_FAILURE);
+ username_token->derivedkeys = derivedkeys;
+
+ return AXIS2_SUCCESS;
+
+}
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_username_token_get_useUTprofile10(
+ rp_username_token_t *username_token,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FALSE);
+
+ return username_token->useUTprofile10;
+
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_username_token_set_useUTprofile10(
+ rp_username_token_t *username_token,
+ const axutil_env_t *env,
+ axis2_bool_t useUTprofile10)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,useUTprofile10,AXIS2_FAILURE);
+ username_token->useUTprofile10 = useUTprofile10;
+
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_username_token_get_useUTprofile11(
+ rp_username_token_t *username_token,
+ const axutil_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FALSE);
+
+ return username_token->useUTprofile10;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_username_token_set_useUTprofile11(
+ rp_username_token_t *username_token,
+ const axutil_env_t *env,
+ axis2_bool_t useUTprofile11)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error,useUTprofile11,AXIS2_FAILURE);
+ username_token->useUTprofile11 = useUTprofile11;
+
+ return AXIS2_SUCCESS;
+}