You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ka...@apache.org on 2007/03/05 09:56:16 UTC

svn commit: r514608 - in /webservices/axis2/trunk/c/rampart: include/oxs_xml_key_processor.h src/omxmlsec/Makefile.am src/omxmlsec/xml_key_processor.c

Author: kaushalye
Date: Mon Mar  5 00:56:15 2007
New Revision: 514608

URL: http://svn.apache.org/viewvc?view=rev&rev=514608
Log:
Adding XML Key Processor to process Key information available in signed XML documents.

Added:
    webservices/axis2/trunk/c/rampart/include/oxs_xml_key_processor.h
    webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_key_processor.c
Modified:
    webservices/axis2/trunk/c/rampart/src/omxmlsec/Makefile.am

Added: webservices/axis2/trunk/c/rampart/include/oxs_xml_key_processor.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_xml_key_processor.h?view=auto&rev=514608
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_xml_key_processor.h (added)
+++ webservices/axis2/trunk/c/rampart/include/oxs_xml_key_processor.h Mon Mar  5 00:56:15 2007
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+
+#ifndef OXS_KEY_PROCESSOR_H
+#define OXS_KEY_PROCESSOR_H
+
+
+/**
+  * @file oxs_xml_signature.h
+  * @brief Does the XML Signature for OMXMLSecurity  
+  */
+
+#include <axis2_defines.h>
+#include <oxs_ctx.h>
+#include <axis2_env.h>
+#include <axiom_node.h>
+#include <axiom_element.h>
+#include <axis2_qname.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/*Process data in a ds:X509Certificate and returns a certificate*/
+AXIS2_EXTERN oxs_x509_cert_t *AXIS2_CALL
+oxs_key_process_X509Certificate(const axis2_env_t *env,
+    axiom_node_t *X509_cert_node);
+
+/*Higher level function ot process an ds:X509Data element*/
+AXIS2_EXTERN oxs_x509_cert_t *AXIS2_CALL
+oxs_key_process_X509Data(const axis2_env_t *env,
+    axiom_node_t *X509_data_node);
+
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif                          /* OXS_KEY_PROCESSOR_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=514608&r1=514607&r2=514608
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/Makefile.am (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/Makefile.am Mon Mar  5 00:56:15 2007
@@ -4,7 +4,7 @@
 libomxmlsec_la_SOURCES = ctx.c  buffer.c key.c cipher.c error.c axis2_utils.c axiom.c \
                          iv.c xml_encryption.c encryption.c\
 						utility.c asym_ctx.c x509_cert.c key_mgr.c sign_part.c sign_ctx.c \
-						xml_signature.c signature.c transform.c transforms_factory.c
+						xml_signature.c signature.c transform.c transforms_factory.c xml_key_processor.c
 						
 
 libomxmlsec_la_LIBADD  = -lssl\

Added: webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_key_processor.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_key_processor.c?view=auto&rev=514608
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_key_processor.c (added)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_key_processor.c Mon Mar  5 00:56:15 2007
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <axis2_util.h>
+#include <oxs_constants.h>
+#include <oxs_error.h>
+#include <oxs_buffer.h>
+#include <oxs_cipher.h>
+#include <oxs_c14n.h>
+#include <oxs_axiom.h>
+#include <oxs_utility.h>
+#include <openssl_rsa.h>
+#include <openssl_digest.h>
+#include <oxs_key_mgr.h>
+#include <oxs_token_x509_data.h>
+#include <oxs_token_x509_certificate.h>
+#include <oxs_token_key_info.h>
+#include <oxs_xml_key_processor.h>
+/*Private functions*/
+
+/*Public functions*/
+
+AXIS2_EXTERN oxs_x509_cert_t *AXIS2_CALL
+oxs_key_process_X509Certificate(const axis2_env_t *env,
+    axiom_node_t *X509_cert_node)
+{
+    axis2_char_t *data = NULL;
+    oxs_x509_cert_t *cert = NULL;
+
+    /*Get contents*/
+    data = oxs_token_get_x509_certificate(env, X509_cert_node);
+    cert = oxs_key_mgr_load_x509_cert_from_string(env, data);
+    
+    return cert;
+}
+
+
+AXIS2_EXTERN oxs_x509_cert_t *AXIS2_CALL
+oxs_key_process_X509Data(const axis2_env_t *env,
+    axiom_node_t *X509_data_node)
+{
+    oxs_x509_cert_t *cert = NULL;
+    axiom_node_t *child_node = NULL;
+    axis2_char_t *child_name = NULL;
+
+    child_node = AXIOM_NODE_GET_FIRST_CHILD( X509_data_node, env);
+    child_name = axiom_util_get_localname(child_node, env);
+    
+    /*Check wht is inside the <ds:X509Data>*/
+    if(0 == axis2_strcmp(child_name, OXS_NODE_X509_CERTIFICATE)){
+        cert = oxs_key_process_X509Certificate(env, child_node);
+    }else if(0 == axis2_strcmp(child_name,OXS_NODE_X509_SUBJECT_NAME )){
+        /*TODO*/ 
+    }else{
+        /*We do not support*/
+
+    }
+    
+    return cert;
+}
+



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