You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ka...@apache.org on 2006/11/28 11:33:47 UTC

svn commit: r479984 - in /webservices/axis2/trunk/c/rampart: include/ src/omxmlsec/

Author: kaushalye
Date: Tue Nov 28 02:33:46 2006
New Revision: 479984

URL: http://svn.apache.org/viewvc?view=rev&rev=479984
Log:
Introducing tokens...
X509IssuerSerial, X509SerialNumber and X509IssuerName

Added:
    webservices/axis2/trunk/c/rampart/include/oxs_token_x509_issuer_name.h
    webservices/axis2/trunk/c/rampart/include/oxs_token_x509_issuer_serial.h
    webservices/axis2/trunk/c/rampart/include/oxs_token_x509_serial_number.h
    webservices/axis2/trunk/c/rampart/src/omxmlsec/token_x509_issuer_name.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/token_x509_issuer_serial.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/token_x509_serial_number.c
Modified:
    webservices/axis2/trunk/c/rampart/src/omxmlsec/Makefile.am

Added: webservices/axis2/trunk/c/rampart/include/oxs_token_x509_issuer_name.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_token_x509_issuer_name.h?view=auto&rev=479984
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_token_x509_issuer_name.h (added)
+++ webservices/axis2/trunk/c/rampart/include/oxs_token_x509_issuer_name.h Tue Nov 28 02:33:46 2006
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+#ifndef OXS_TOKEN_X509_ISSUER_NAME_H
+#define OXS_TOKEN_X509_ISSUER_NAME_H
+
+
+/**
+  * @file 
+  * @brief 
+  */
+
+#include <axis2_defines.h>
+#include <axis2_env.h>
+#include <axiom_node.h>
+#include <axiom_element.h>
+#include <axis2_qname.h>
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/**
+* X509IssuerName element
+*/
+
+AXIS2_EXTERN axis2_char_t* AXIS2_CALL
+oxs_token_get_issuer_name(const axis2_env_t *env,
+        axiom_node_t *issuer_name_node);
+
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+oxs_token_build_issuer_name_element(const axis2_env_t *env,
+        axiom_node_t *parent,
+        axis2_char_t* value );
+
+/*TODO write free method*/
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif                          /* OXS_TOKEN_X509_ISSUER_NAME_H */

Added: webservices/axis2/trunk/c/rampart/include/oxs_token_x509_issuer_serial.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_token_x509_issuer_serial.h?view=auto&rev=479984
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_token_x509_issuer_serial.h (added)
+++ webservices/axis2/trunk/c/rampart/include/oxs_token_x509_issuer_serial.h Tue Nov 28 02:33:46 2006
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+#ifndef OXS_TOKEN_X509_ISSUER_SERIAL_H
+#define OXS_TOKEN_X509_ISSUER_SERIAL_H
+
+
+/**
+  * @file 
+  * @brief 
+  */
+
+#include <axis2_defines.h>
+#include <axis2_env.h>
+#include <axiom_node.h>
+#include <axiom_element.h>
+#include <axis2_qname.h>
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/**
+* X509Data element
+*/
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+oxs_token_build_x509_issuer_serial_element(const axis2_env_t *env,
+        axiom_node_t *parent);
+
+
+/*TODO write free method*/
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif                          /* OXS_TOKEN_X509_ISSUER_SERIAL_H */

Added: webservices/axis2/trunk/c/rampart/include/oxs_token_x509_serial_number.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_token_x509_serial_number.h?view=auto&rev=479984
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_token_x509_serial_number.h (added)
+++ webservices/axis2/trunk/c/rampart/include/oxs_token_x509_serial_number.h Tue Nov 28 02:33:46 2006
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+#ifndef OXS_TOKEN_X509_SERIAL_NUMBER_H
+#define OXS_TOKEN_X509_SERIAL_NUMBER_H
+
+
+/**
+  * @file 
+  * @brief 
+  */
+
+#include <axis2_defines.h>
+#include <axis2_env.h>
+#include <axiom_node.h>
+#include <axiom_element.h>
+#include <axis2_qname.h>
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/**
+* X509IssuerName element
+*/
+
+AXIS2_EXTERN axis2_char_t* AXIS2_CALL
+oxs_token_get_serial_number(const axis2_env_t *env,
+        axiom_node_t *serial_number_node);
+
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+oxs_token_build_serial_number_element(const axis2_env_t *env,
+        axiom_node_t *parent,
+        axis2_char_t* value );
+
+/*TODO write free method*/
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif                          /* OXS_TOKEN_X509_SERIAL_NUMBER_H */

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/Makefile.am?view=diff&rev=479984&r1=479983&r2=479984
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/Makefile.am (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/Makefile.am Tue Nov 28 02:33:46 2006
@@ -5,7 +5,8 @@
                         token_encrypted_data.c token_encryption_method.c token_cipher_value.c \
                         token_cipher_data.c token_key_name.c token_key_info.c token_binary_security_token.c \
                         token_reference_list.c token_data_reference.c token_encrypted_key.c iv.c xml_encryption.c encryption.c\
-						utility.c asym_ctx.c x509_cert.c key_mgr.c token_key_identifier.c
+						utility.c asym_ctx.c x509_cert.c key_mgr.c token_key_identifier.c token_x509_data.c token_x509_issuer_serial.c\
+						token_x509_issuer_name.c token_x509_serial_number.c
 
 libomxmlsec_la_LIBADD  = -lssl\
 			../../../util/src/libaxis2_util.la \

Added: webservices/axis2/trunk/c/rampart/src/omxmlsec/token_x509_issuer_name.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/token_x509_issuer_name.c?view=auto&rev=479984
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/token_x509_issuer_name.c (added)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/token_x509_issuer_name.c Tue Nov 28 02:33:46 2006
@@ -0,0 +1,66 @@
+/*
+ *   Copyright 2003-2004 The Apache Software Foundation.
+ *
+ *   Licensed 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_token_x509_issuer_name.h>
+#include <axiom_element.h>
+#include <oxs_axiom.h>
+
+
+AXIS2_EXTERN axis2_char_t* AXIS2_CALL
+oxs_token_get_issuer_name(const axis2_env_t *env,
+        axiom_node_t *issuer_name_node)
+{
+    axis2_char_t *val = NULL;
+    /*TODO Verification*/
+    val = (axis2_char_t*)oxs_axiom_get_node_content(env, issuer_name_node);
+    return val;
+
+}
+
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+oxs_token_build_issuer_name_element(const axis2_env_t *env,
+        axiom_node_t *parent,
+        axis2_char_t* value
+                                    )
+{
+    axiom_node_t *issuer_name_node = NULL;
+    axiom_element_t *issuer_name_ele = NULL;
+    axis2_status_t ret;
+    axiom_namespace_t *ns_obj = NULL;
+
+    ns_obj = axiom_namespace_create(env, OXS_DSIG_NS,
+            OXS_DS);
+
+    issuer_name_ele = axiom_element_create(env, parent, OXS_NODE_X509_ISSUER_NAME, ns_obj, &issuer_name_node);
+    if (!issuer_name_ele)
+    {
+        oxs_error(ERROR_LOCATION,
+                OXS_ERROR_ELEMENT_FAILED, "Error creating  element");
+        return NULL;
+    }
+
+    if (value)
+    {
+        ret  = AXIOM_ELEMENT_SET_TEXT(issuer_name_ele, env, value, issuer_name_node);
+    }
+
+    return issuer_name_node;
+
+}
+

Added: webservices/axis2/trunk/c/rampart/src/omxmlsec/token_x509_issuer_serial.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/token_x509_issuer_serial.c?view=auto&rev=479984
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/token_x509_issuer_serial.c (added)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/token_x509_issuer_serial.c Tue Nov 28 02:33:46 2006
@@ -0,0 +1,46 @@
+/*
+ *   Copyright 2003-2004 The Apache Software Foundation.
+ *
+ *   Licensed 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_token_x509_issuer_serial.h>
+#include <axiom_element.h>
+
+
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+oxs_token_build_x509_issuer_serial_element(const axis2_env_t *env,
+        axiom_node_t *parent)
+{
+    axiom_node_t *x509_issuer_serial_node = NULL;
+    axiom_element_t *x509_issuer_serial_ele = NULL;
+    axiom_namespace_t *ns_obj = NULL;
+
+    ns_obj = axiom_namespace_create(env, OXS_DSIG_NS,
+            OXS_DS);
+
+
+    x509_issuer_serial_ele = axiom_element_create(env, parent, OXS_NODE_X509_ISSUER_SERIAL, ns_obj, &x509_issuer_serial_node);
+    if (!x509_issuer_serial_ele)
+    {
+        oxs_error(ERROR_LOCATION,
+                OXS_ERROR_ELEMENT_FAILED, "Error creating X509IssuerSerial element");
+        return NULL;
+    }
+
+    return x509_issuer_serial_node;
+}
+

Added: webservices/axis2/trunk/c/rampart/src/omxmlsec/token_x509_serial_number.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/token_x509_serial_number.c?view=auto&rev=479984
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/token_x509_serial_number.c (added)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/token_x509_serial_number.c Tue Nov 28 02:33:46 2006
@@ -0,0 +1,66 @@
+/*
+ *   Copyright 2003-2004 The Apache Software Foundation.
+ *
+ *   Licensed 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_token_x509_serial_number.h>
+#include <axiom_element.h>
+#include <oxs_axiom.h>
+
+
+AXIS2_EXTERN axis2_char_t* AXIS2_CALL
+oxs_token_get_serial_number(const axis2_env_t *env,
+        axiom_node_t *serial_number_node)
+{
+    axis2_char_t *val = NULL;
+    /*TODO Verification*/
+    val = (axis2_char_t*)oxs_axiom_get_node_content(env, serial_number_node);
+    return val;
+
+}
+
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+oxs_token_build_serial_number_element(const axis2_env_t *env,
+        axiom_node_t *parent,
+        axis2_char_t* value
+                                    )
+{
+    axiom_node_t *serial_number_node = NULL;
+    axiom_element_t *serial_number_ele = NULL;
+    axis2_status_t ret;
+    axiom_namespace_t *ns_obj = NULL;
+
+    ns_obj = axiom_namespace_create(env, OXS_DSIG_NS,
+            OXS_DS);
+
+    serial_number_ele = axiom_element_create(env, parent, OXS_NODE_X509_SERIAL_NUMBER, ns_obj, &serial_number_node);
+    if (!serial_number_ele)
+    {
+        oxs_error(ERROR_LOCATION,
+                OXS_ERROR_ELEMENT_FAILED, "Error creating  element");
+        return NULL;
+    }
+
+    if (value)
+    {
+        ret  = AXIOM_ELEMENT_SET_TEXT(serial_number_ele, env, value, serial_number_node);
+    }
+
+    return serial_number_node;
+
+}
+



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