From 9a0670ad01e00ab01cfb4f308f1b124941968fa2 Mon Sep 17 00:00:00 2001 From: m0gg Date: Tue, 28 Nov 2006 23:45:57 +0000 Subject: XML signature improvements --- libcsoap/soap-xmlsec.h | 84 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 75 insertions(+), 9 deletions(-) (limited to 'libcsoap/soap-xmlsec.h') diff --git a/libcsoap/soap-xmlsec.h b/libcsoap/soap-xmlsec.h index fc24fc5..9943498 100644 --- a/libcsoap/soap-xmlsec.h +++ b/libcsoap/soap-xmlsec.h @@ -1,5 +1,5 @@ /****************************************************************** - * $Id: soap-xmlsec.h,v 1.2 2006/11/27 11:15:27 m0gg Exp $ + * $Id: soap-xmlsec.h,v 1.3 2006/11/28 23:45:57 m0gg Exp $ * * CSOAP Project: A SOAP client/server library in C * Copyright (C) 2006 Heiko Ronsdorf @@ -31,13 +31,17 @@ * This module is implemented using the xmlsec1 library. * * @author H. Ronsdorf - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * - * @see http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wss - * http://www.aleksey.com/xmlsec/, + * @see http://www.w3.org/TR/SOAP-dsig/, + * http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wss, + * http://www.aleksey.com/xmlsec/ * */ +#define SOAP_SECURITY_NAMESPACE "http://schemas.xmlsoap.org/soap/security/2000-12" +#define SOAP_SECURITY_PREFIX "SOAP-SEC" + /** * * Commandline argument to enabled WS-Security. @@ -45,6 +49,28 @@ */ #define CSOAP_ENABLE_XMLSEC "-CSOAPxmlsec" +/** + * + * Commandline argument to set the keyfile. If this argument is not specified a + * random key will be used. + * + */ +#define CSOAP_XMLSEC_KEYFILE "-CSOAPkeyfile" + +/** + * + * Commandline argument to set the password of the key. + * + */ +#define CSOAP_XMLSEC_PASSWORD "-CSOAPpassword" + +/** + * + * Commandline argument to set a file of certificates. + * + */ +#define CSOAP_XMLSEC_CERTFILE "-CSOAPcertfile" + #ifdef __cplusplus extern "C" { #endif @@ -56,19 +82,45 @@ extern "C" { * @param argc commandline arg count * @param argv commandline arg vector * - * @returns H_OK on success + * @return H_OK on success * */ -extern herror_t soap_xmlsec_init_args(int argc, char **argv); +extern herror_t soap_xmlsec_server_init_args(int argc, char **argv); /** * - * Sign a XML document contained in a SOAP Envelope + * Initializes the WS-Security subsystem. + * + * @param argc commandline arg count + * @param argv commandline arg vector + * + * @return H_OK on success + * + */ +extern herror_t soap_xmlsec_client_init_args(int argc, char **argv); + +/** + * + * Sign a XML document contained in a SOAP Envelope. The key specified on the + * commandline is used for signating the document. * * @param envelope The SOAP envelope to be signed. * + * @return H_OK on success + * */ -extern herror_t soap_xmlsec_sign(struct SoapEnv *envelope); +extern herror_t soap_xmlsec_sign(struct SoapCtx *context); + +/** + * + * Verify a XML documents signature contained in a SOAP Envelope. + * + * @param envelope The SOAP envelope to be verified. + * + * @return H_OK on success + * + */ +extern herror_t soap_xmlsec_verify(struct SoapCtx *context); /** * @@ -76,8 +128,22 @@ extern herror_t soap_xmlsec_sign(struct SoapEnv *envelope); * * @param envelope The SOAP envelope to be encrypted. * + * @return H_OK on success + * + */ +extern herror_t soap_xmlsec_encrypt(struct SoapCtx *context); + +/** + * + * Decrupt a XML document contained in a SOAP envelope. + * + * @param envelope The SOAP envelope to be decrypted. + * + * @return H_OK on success + * */ -extern herror_t soap_xmlsec_encrypt(struct SoapEnv *envelope); +extern herror_t soap_xmlsec_decrypt(struct SoapCtx *context); + /** * -- cgit v1.1-32-gdbae