axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kausha...@apache.org
Subject svn commit: r514997 - in /webservices/axis2/trunk/c/rampart: include/oxs_xml_key_processor.h src/omxmlsec/xml_key_processor.c src/omxmlsec/xml_signature.c test/omxmlsec/test.c
Date Tue, 06 Mar 2007 06:39:13 GMT
Author: kaushalye
Date: Mon Mar  5 22:39:12 2007
New Revision: 514997

URL: http://svn.apache.org/viewvc?view=rev&rev=514997
Log:
Adding two more key information processing patterns to OMXMLSecurity. X509SKI and X509 Subject
Name

Modified:
    webservices/axis2/trunk/c/rampart/include/oxs_xml_key_processor.h
    webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_key_processor.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_signature.c
    webservices/axis2/trunk/c/rampart/test/omxmlsec/test.c

Modified: 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=diff&rev=514997&r1=514996&r2=514997
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_xml_key_processor.h (original)
+++ webservices/axis2/trunk/c/rampart/include/oxs_xml_key_processor.h Mon Mar  5 22:39:12
2007
@@ -35,6 +35,15 @@
 extern "C"
 {
 #endif
+/*Process a ds:X509SKI element and populate a certificate */
+AXIS2_EXTERN oxs_x509_cert_t *AXIS2_CALL
+oxs_xml_key_process_X509SKI(const axis2_env_t *env,
+    axiom_node_t *X509SKI_node);
+
+/*Process a ds:X509SubjectName element and populate a  certificate*/
+AXIS2_EXTERN oxs_x509_cert_t *AXIS2_CALL
+oxs_xml_key_process_X509SubjectName(const axis2_env_t *env,
+    axiom_node_t *X509_subj_name_node);
 
 /*Process a ds:X509IssuerSerial element and populate a certificate*/
 AXIS2_EXTERN oxs_x509_cert_t *AXIS2_CALL

Modified: 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=diff&rev=514997&r1=514996&r2=514997
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_key_processor.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_key_processor.c Mon Mar  5 22:39:12
2007
@@ -37,6 +37,49 @@
 
 /*Public functions*/
 AXIS2_EXTERN oxs_x509_cert_t *AXIS2_CALL
+oxs_xml_key_process_X509SKI(const axis2_env_t *env,
+    axiom_node_t *X509SKI_node)
+{
+    oxs_x509_cert_t *cert = NULL;
+    axis2_char_t *ski = NULL;
+    axis2_char_t *node_name = NULL;
+
+    node_name = axiom_util_get_localname(X509SKI_node, env);
+    if(0 != axis2_strcmp(node_name, OXS_NODE_X509_SKI)){
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,"Invalid node. Expected %s.
Found", OXS_NODE_X509_SKI, node_name);
+        return NULL;
+    }
+
+    ski = oxs_axiom_get_node_content(env, X509SKI_node); 
+    cert = oxs_x509_cert_create(env); 
+    oxs_x509_cert_set_subject(cert, env, ski);
+
+    return cert;
+
+}
+
+AXIS2_EXTERN oxs_x509_cert_t *AXIS2_CALL
+oxs_xml_key_process_X509SubjectName(const axis2_env_t *env,
+    axiom_node_t *X509_subj_name_node)
+{
+    oxs_x509_cert_t *cert = NULL;
+    axis2_char_t *subj_name = NULL;
+    axis2_char_t *node_name = NULL;
+
+    node_name = axiom_util_get_localname(X509_subj_name_node, env);
+    if(0 != axis2_strcmp(node_name, OXS_NODE_X509_SUBJECT_NAME)){
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,"Invalid node. Expected %s.
Found", OXS_NODE_X509_SUBJECT_NAME, node_name);
+        return NULL;
+    }
+
+    subj_name = oxs_axiom_get_node_content(env, X509_subj_name_node); 
+    cert = oxs_x509_cert_create(env); 
+    oxs_x509_cert_set_subject(cert, env, subj_name);
+
+    return cert;
+}
+
+AXIS2_EXTERN oxs_x509_cert_t *AXIS2_CALL
 oxs_xml_key_process_X509IssuerSerial(const axis2_env_t *env,
     axiom_node_t *X509_issuer_serial_node)
 {
@@ -52,16 +95,15 @@
         oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,"Invalid node. Expected %s.
Found", OXS_NODE_X509_ISSUER_SERIAL, node_name);
         return NULL;
     }
-
     
     issuer_name_node =  AXIOM_NODE_GET_FIRST_CHILD(X509_issuer_serial_node, env);
     if(issuer_name_node){
-        issuer_name = oxs_token_get_issuer_name(env, issuer_name_node);
+        issuer_name = oxs_axiom_get_node_content(env, issuer_name_node); 
     }
     
     serial_num_node = AXIOM_NODE_GET_NEXT_SIBLING(issuer_name_node, env);
     if(serial_num_node){
-        serial_num_str = oxs_token_get_serial_number(env, serial_num_node);
+        serial_num_str = oxs_axiom_get_node_content(env, serial_num_node); 
     }
     
     /*we set the key issuername and the serial number*/
@@ -93,6 +135,7 @@
 }
 
 
+
 AXIS2_EXTERN oxs_x509_cert_t *AXIS2_CALL
 oxs_xml_key_process_X509Data(const axis2_env_t *env,
     axiom_node_t *X509_data_node)
@@ -110,16 +153,17 @@
     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>*/
+    /*Check wht's inside the <ds:X509Data>*/
     if(0 == axis2_strcmp(child_name, OXS_NODE_X509_CERTIFICATE)){
         cert = oxs_xml_key_process_X509Certificate(env, child_node);
     }else if(0 == axis2_strcmp(child_name, OXS_NODE_X509_ISSUER_SERIAL)){
          cert = oxs_xml_key_process_X509IssuerSerial(env, child_node);
-    }else if(0 == axis2_strcmp(child_name,OXS_NODE_X509_SUBJECT_NAME )){
-        /*TODO*/ 
+    }else if(0 == axis2_strcmp(child_name, OXS_NODE_X509_SUBJECT_NAME )){
+        cert = oxs_xml_key_process_X509SubjectName(env, child_node);
+    }else if(0 == axis2_strcmp(child_name, OXS_NODE_X509_SKI )){
+        cert = oxs_xml_key_process_X509SKI(env, child_node);
     }else{
         /*We do not support*/
-
     }
     
     return cert;

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_signature.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_signature.c?view=diff&rev=514997&r1=514996&r2=514997
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_signature.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_signature.c Mon Mar  5 22:39:12 2007
@@ -278,7 +278,7 @@
     int i=0;
 
     /*Construct the <Signature> element*/
-    signature_node = oxs_token_build_signature_element(env, parent, "Sign-ID");
+    signature_node = oxs_token_build_signature_element(env, parent,  oxs_util_generate_id(env,OXS_SIG_ID));
 
     /*Construct the <SignedInfo>  */
     signed_info_node = oxs_token_build_signed_info_element(env, signature_node);

Modified: webservices/axis2/trunk/c/rampart/test/omxmlsec/test.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/test/omxmlsec/test.c?view=diff&rev=514997&r1=514996&r2=514997
==============================================================================
--- webservices/axis2/trunk/c/rampart/test/omxmlsec/test.c (original)
+++ webservices/axis2/trunk/c/rampart/test/omxmlsec/test.c Mon Mar  5 22:39:12 2007
@@ -204,7 +204,7 @@
         certfile = argv[3];
         prvkeyfile = argv[4];
     }else{
-        printf("Usage ./test inputfile prvkey certificate operation[S/V]\n");
+        printf("Usage ./test inputfile operation[S/V] certificate prvkey \n");
         return -1;
     }
     



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


Mime
View raw message