<div>The password to the appended .pem file is "bala".</div>
<div><br><br> </div>
<div><span class="gmail_quote">On 12/4/06, <b class="gmail_sendername">Yeshwanth C</b> <<a href="mailto:cyeshwanth@gmail.com">cyeshwanth@gmail.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">Hi Aleksey,</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">I am literally trying out the sample you have given in the tutorials.</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">I am pasting it below. Upon debugging, the point of failure is detected in the following function in file xmldsig.c and marked in red. </span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"></span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">static int</span></font></p>
<p><b><font face="Courier New" color="red" size="2"><span style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: red">xmlSecDSigCtxProcessSignatureNode</span></font></b>(xmlSecDSigCtxPtr dsigCtx, xmlNodePtr node) { </p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xmlSecTransformDataType firstType;</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xmlNodePtr signedInfoNode = NULL;</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xmlNodePtr keyInfoNode = NULL;</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xmlNodePtr cur;</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> int ret;</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"></span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xmlSecAssert2(dsigCtx != NULL, -1);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xmlSecAssert2((dsigCtx->operation == xmlSecTransformOperationSign) || (dsigCtx->operation == xmlSecTransformOperationVerify), -1); </span></font>
</p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xmlSecAssert2(dsigCtx->status == xmlSecDSigStatusUnknown, -1);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xmlSecAssert2(dsigCtx->signValueNode == NULL, -1);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xmlSecAssert2(dsigCtx->signMethod == NULL, -1);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"></span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">//<b><font color="red"><span style="FONT-WEIGHT: bold; COLOR: red">BELOW LINE IS WHERE THE CODE FAILS -</span></font></b></span></font> </p>
<p><b><font face="Courier New" color="red" size="2"><span style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: red"> xmlSecAssert2(dsigCtx->c14nMethod == NULL, -1); </span></font></b></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"></span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xmlSecAssert2(node != NULL, -1);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">.....</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"></span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">}</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"></span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">The client code is pasted below - </span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"></span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">#include <stdlib.h></span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">#include <string.h></span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">#include <assert.h></span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">#include <libxml/tree.h></span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">#include <libxml/xmlmemory.h></span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">#include <libxml/parser.h></span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">#define XMLSEC_CRYPTO_OPENSSL</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">#ifndef XMLSEC_NO_XSLT</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">#include <libxslt/xslt.h></span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">#endif /* XMLSEC_NO_XSLT */</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">#include <xmlsec/xmlsec.h></span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">#include <xmlsec/xmltree.h></span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">#include <xmlsec/xmldsig.h></span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">#include <xmlsec/crypto.h></span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">int sign_file(const char* tmpl_file, const char* key_file); </span></font>
</p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">int </span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">main(int argc, char **argv) {</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> assert(argv);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> if(argc != 3) {</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> fprintf(stderr, "Error: wrong number of arguments.\n");</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> fprintf(stderr, "Usage: %s <tmpl-file> <key-file>\n", argv[0]);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> return(1);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> }</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> /* Init libxml and libxslt libraries */</span></font> </p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xmlInitParser();</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> LIBXML_TEST_VERSION</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xmlSubstituteEntitiesDefault(1);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">#ifndef XMLSEC_NO_XSLT</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xmlIndentTreeOutput = 1; </span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">#endif /* XMLSEC_NO_XSLT */</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> /* Init xmlsec library */</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> if(xmlSecInit() < 0) {</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> fprintf(stderr, "Error: xmlsec initialization failed.\n");</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> return(-1);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> }</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> /* Check loaded library version */</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> if(xmlSecCheckVersion() != 1) {</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> fprintf(stderr, "Error: loaded xmlsec library version is not compatible.\n");</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> return(-1);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> }</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> /* Load default crypto engine if we are supporting dynamic </span></font>
</p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> * loading for xmlsec-crypto libraries. Use the crypto library</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> * name ("openssl", "nss", etc.) to load corresponding </span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> * xmlsec-crypto library.</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> */</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">#ifdef XMLSEC_CRYPTO_DYNAMIC_LOADING</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> if(xmlSecCryptoDLLoadLibrary(BAD_CAST XMLSEC_CRYPTO) < 0) {</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> fprintf(stderr, "Error: unable to load default xmlsec-crypto library. Make sure\n"</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> "that you have it installed and check shared libraries path\n"</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> "(LD_LIBRARY_PATH) envornment variable.\n");</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> return(-1); </span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> }</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">#endif /* XMLSEC_CRYPTO_DYNAMIC_LOADING */</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> /* Init crypto library */</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> if(xmlSecCryptoAppInit(NULL) < 0) {</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> fprintf(stderr, "Error: crypto initialization failed.\n");</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> return(-1);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> }</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> /* Init xmlsec-crypto library */</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> if(xmlSecCryptoInit() < 0) {</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> fprintf(stderr, "Error: xmlsec-crypto initialization failed.\n");</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> return(-1);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> }</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> if(sign_file(argv[1], argv[2]) < 0) {</span></font> </p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> return(-1);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> } </span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> /* Shutdown xmlsec-crypto library */</span></font> </p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xmlSecCryptoShutdown();</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> /* Shutdown crypto library */</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xmlSecCryptoAppShutdown();</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> /* Shutdown xmlsec library */</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xmlSecShutdown();</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> /* Shutdown libxslt/libxml */</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">#ifndef XMLSEC_NO_XSLT</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xsltCleanupGlobals(); </span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">#endif /* XMLSEC_NO_XSLT */</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xmlCleanupParser();</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> return(0);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">}</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">/** </span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> * sign_file:</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> * @tmpl_file: the signature template file name.</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> * @key_file: the PEM private key file name.</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> *</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> * Signs the #tmpl_file using private key from #key_file.</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> *</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> * Returns 0 on success or a negative value if an error occurs.</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> */</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">int </span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">sign_file(const char* tmpl_file, const char* key_file) {</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xmlDocPtr doc = NULL;</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xmlNodePtr node = NULL;</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xmlSecDSigCtxPtr dsigCtx = NULL;</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> int res = -1;</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> assert(tmpl_file);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> assert(key_file);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> /* load template */</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> doc = xmlParseFile(tmpl_file);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> if ((doc == NULL) || (xmlDocGetRootElement(doc) == NULL)){</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> fprintf(stderr, "Error: unable to parse file \"%s\"\n", tmpl_file);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> goto done; </span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> }</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> /* find start node */</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> node = xmlSecFindNode(xmlDocGetRootElement(doc), xmlSecNodeSignature, xmlSecDSigNs);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> if(node == NULL) {</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> fprintf(stderr, "Error: start node not found in \"%s\"\n", tmpl_file);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> goto done; </span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> }</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> /* create signature context, we don't need keys manager in this example */
</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> dsigCtx = xmlSecDSigCtxCreate(NULL);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> if(dsigCtx == NULL) {</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> fprintf(stderr,"Error: failed to create signature context\n");</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> goto done;</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> }</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> /* load private key, assuming that there is not password */ </span></font>
</p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> dsigCtx->signKey = xmlSecCryptoAppKeyLoad(key_file, xmlSecKeyDataFormatPem, /*NULL*/"bala", NULL, NULL);</span></font> </p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> if(dsigCtx->signKey == NULL) {</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> fprintf(stderr,"Error: failed to load private pem key from \"%s\"\n", key_file);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> goto done;</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> }</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> /* set key name to the file name, this is just an example! */ </span></font>
</p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> if(xmlSecKeySetName(dsigCtx->signKey, BAD_CAST (key_file)) < 0) {</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> fprintf(stderr,"Error: failed to set key name for key from \"%s\"\n", key_file);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> goto done;</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> }</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><b><font face="Courier New" color="red" size="2"><span style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: red"> /* sign the template */
</span></font></b></p>
<p><b><font face="Courier New" color="red" size="2"><span style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: red"> if(xmlSecDSigCtxSign(dsigCtx, node) < 0) {</span></font></b></p>
<p><b><font face="Courier New" color="red" size="2"><span style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: red"> fprintf(stderr,"Error: signature failed\n");</span></font></b></p>
<p><b><font face="Courier New" color="red" size="2"><span style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: red"> goto done;</span></font></b></p>
<p><b><font face="Courier New" color="red" size="2"><span style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: red"> }</span></font></b></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> /* print signed document to stdout */</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xmlDocDump(stdout, doc);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> /* success */</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> res = 0;</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">done: </span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> /* cleanup */</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> if(dsigCtx != NULL) {</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xmlSecDSigCtxDestroy(dsigCtx);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> }</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> if(doc != NULL) {</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> xmlFreeDoc(doc); </span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> }</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> return(res);</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">}</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">The xml file and key file are also pasted below - </span></font></p>
<p style="TEXT-INDENT: -12pt"><span><font face="Verdana" color="blue" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><?</span></font></span><span><font face="Verdana" color="blue" size="2"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
xml version="1.0" encoding="UTF-8" </span></font></span><span><font face="Verdana" color="blue" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">?></span></font></span><font face="Verdana" size="2">
<span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> </span></font></p>
<p style="MARGIN-LEFT: 12pt"><span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><a title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##"><b title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##">
<font title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##" face="Courier New" color="red"><span title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##" style="FONT-WEIGHT: bold; COLOR: red">
-</span></font></b></a> </span></font></span><span><font face="Verdana" color="blue" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><!--</span></font></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
</span></font><span><font face="Courier" color="#888888"></font></span></p><span><pre style="MARGIN-LEFT: 12pt"><font face="Courier New" color="#888888" size="2"><span style="FONT-SIZE: 10pt; COLOR: #888888">
</span></font></pre><pre style="MARGIN-LEFT: 12pt"><font face="Courier New" color="#888888" size="2"><span style="FONT-SIZE: 10pt; COLOR: #888888">XML Security Library example: Simple signature template file for sign1 example.
</span></font></pre></span>
<p style="TEXT-INDENT: -12pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue">--></font></span><span></span> </span></font></p>
<p style="TEXT-INDENT: -24pt"><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><a title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##"><b title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##">
<font title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##" face="Courier New" color="red"><span title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##" style="FONT-WEIGHT: bold; COLOR: red">
-</span></font></b></a> <span><font color="blue"><</font></span><span><font color="#990000">Envelope</font></span><span><font color="red"> xmlns</font></span><span><font color="blue"> ="</font></span><b><font color="red">
<span style="FONT-WEIGHT: bold; COLOR: red">urn:envelope</span></font></b><span><font color="blue">"></font></span></span></font></p>
<p style="TEXT-INDENT: -24pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"><</font></span><span><font color="#990000">Data</font></span><span><font color="blue">></font></span><span><b>Hello, World!</b></span><span> <font color="blue"></</font></span><span><font color="#990000">
Data</font></span><span><font color="blue">></font></span> </span></font></p>
<p style="TEXT-INDENT: -24pt"><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><a title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##"><b title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##">
<font title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##" face="Courier New" color="red"><span title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##" style="FONT-WEIGHT: bold; COLOR: red">
-</span></font></b></a> <span><font color="blue"><</font></span><span><font color="#990000">Signature</font></span><span><font color="red"> xmlns</font></span><span><font color="blue"> ="</font></span><b><font color="red">
<span style="FONT-WEIGHT: bold; COLOR: red"><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.w3.org/2000/09/xmldsig#" target="_blank">http://www.w3.org/2000/09/xmldsig#</a></span></font></b><span>
<font color="blue"> "></font></span></span></font></p>
<p style="TEXT-INDENT: -24pt"><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><a title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##"><b title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##">
<font title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##" face="Courier New" color="red"><span title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##" style="FONT-WEIGHT: bold; COLOR: red">
-</span></font></b></a> <span><font color="blue"><</font></span><span><font color="#990000">SignedInfo</font></span><span><font color="blue">></font></span></span></font></p>
<p style="TEXT-INDENT: -24pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"><</font></span><span><font color="#990000">CanonicalizationMethod</font></span> <span><font color="#990000">Algorithm</font></span><span><font color="blue"> ="</font></span><b><span style="FONT-WEIGHT: bold">
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" target="_blank">http://www.w3.org/TR/2001/REC-xml-c14n-20010315</a></span></b><span><font color="blue">" />
</font></span></span></font></p>
<p style="TEXT-INDENT: -24pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"><</font></span><span><font color="#990000">SignatureMethod</font></span> <span><font color="#990000">Algorithm</font></span><span><font color="blue"> ="</font></span><b><span style="FONT-WEIGHT: bold">
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.w3.org/2000/09/xmldsig#rsa-sha1" target="_blank">http://www.w3.org/2000/09/xmldsig#rsa-sha1</a></span></b><span><font color="blue">" /></font>
</span></span></font></p>
<p style="TEXT-INDENT: -24pt"><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><a title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##"><b title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##">
<font title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##" face="Courier New" color="red"><span title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##" style="FONT-WEIGHT: bold; COLOR: red">
-</span></font></b></a> <span><font color="blue"><</font></span><span><font color="#990000">Reference URI</font></span><span><font color="blue">=""></font></span></span></font> </p>
<p style="TEXT-INDENT: -24pt"><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><a title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##"><b title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##">
<font title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##" face="Courier New" color="red"><span title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##" style="FONT-WEIGHT: bold; COLOR: red">
-</span></font></b></a> <span><font color="blue"><</font></span><span><font color="#990000">Transforms</font></span><span><font color="blue">></font></span></span></font></p>
<p style="TEXT-INDENT: -24pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"><</font></span><span><font color="#990000">Transform</font></span> <span><font color="#990000">Algorithm</font></span><span><font color="blue">=" </font></span><b><span style="FONT-WEIGHT: bold">
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.w3.org/2000/09/xmldsig#enveloped-signature" target="_blank">http://www.w3.org/2000/09/xmldsig#enveloped-signature</a></span></b><span><font color="blue">
" /> </font></span></span></font></p>
<p style="TEXT-INDENT: -12pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"></</font></span><span><font color="#990000">Transforms</font></span><span><font color="blue">></font></span></span></font></p>
<p style="TEXT-INDENT: -24pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"><</font></span><span><font color="#990000">DigestMethod</font></span> <span><font color="#990000">Algorithm</font></span><span><font color="blue">=" </font></span><b><span style="FONT-WEIGHT: bold">
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.w3.org/2000/09/xmldsig#sha1" target="_blank">http://www.w3.org/2000/09/xmldsig#sha1</a></span></b><span><font color="blue">" /></font></span>
</span></font></p>
<p style="TEXT-INDENT: -24pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"><</font></span><span><font color="#990000">DigestValue</font></span> <span><font color="blue">/></font></span> </span></font></p>
<p style="TEXT-INDENT: -12pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"></</font></span><span><font color="#990000">Reference</font></span><span><font color="blue">></font></span></span></font></p>
<p style="TEXT-INDENT: -12pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"></</font></span><span><font color="#990000">SignedInfo</font></span><span><font color="blue">></font></span></span></font></p>
<p style="TEXT-INDENT: -24pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"><</font></span><span><font color="#990000">SignatureValue</font></span> <span><font color="blue">/></font></span> </span></font></p>
<p style="TEXT-INDENT: -24pt"><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><a title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##"><b title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##">
<font title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##" face="Courier New" color="red"><span title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/bin/Debug/write.xml##" style="FONT-WEIGHT: bold; COLOR: red">
-</span></font></b></a> <span><font color="blue"><</font></span><span><font color="#990000">KeyInfo</font></span><span><font color="blue">></font></span></span></font></p>
<p style="TEXT-INDENT: -24pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"><</font></span><span><font color="#990000">KeyName</font></span> <span><font color="blue">/></font></span> </span></font></p>
<p style="TEXT-INDENT: -12pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"></</font></span><span><font color="#990000">KeyInfo</font></span><span><font color="blue">></font></span></span></font></p>
<p style="TEXT-INDENT: -12pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"></</font></span><span><font color="#990000">Signature</font></span><span><font color="blue">></font></span></span></font></p>
<p style="TEXT-INDENT: -12pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"></</font></span><span><font color="#990000">Envelope</font></span><span><font color="blue">></font></span></span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">The .pem file contents are also pasted below:-</span> </font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">-----BEGIN RSA PRIVATE KEY-----</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">Proc-Type: 4,ENCRYPTED</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">DEK-Info: DES-EDE3-CBC,0F27CF23A060B31A</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">ft00DxahgotEwqK8R/w0uOB0288Qdf+5ha1laHXOSgGS9saeFpt2fIEddGsjJ5RS</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">nEoTFVPMj4p3vwaUXtnSVNZ7gNL//xXXYNzXMQBI1AyMGVrJIRhsLs0lr0+qcMCN</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">QRji51z8qssKNh2vcQRy/Y4YD8gj4bFYDPGmE9bWlTJhV4wLzdh8DYxis/LJdBye</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">T2dlHP2HYAybWMrRq3AvyeP8HArvXphPbdQ3sBomwBp+HbuuLhRLnEHu1nFM6RjW</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">BApzyyiBsKcld7AgRjWtMOocB3mzDtPZnFygRIFF5eJcaj0hywdcJ/lPQzbKe0RP</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">fEy01L0VxFQ+T/JRTQwJfRV8Irc2Z9ypZ0JPwe86NoeOsaMjTCpvXFg4UAgMWWSp</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">mxR1uVjbXkAh80Bp0tZDlFMxk+bs2eTQtNbBBNyE9asxxeveMmsDFw6XIovKkV3N</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">KuUaQEz9tx9QJh8thzgLLdCXcotcul/VdlBtHFKMfKruAJ6uFT/gvhDh//oQjDaE</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">tyGMCP2xCM4DFdWVlrodkVh3wUJV4RQArsjWh8G8qM7CORY/jINXEyhzxSSx8iBz</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">Mztq7G7S2uNx983MMqlfeHrkYHmStcTyFz7D8z/g8cxfyjCRbrSmHbtz3/F6Y21Z</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">1+Q1b7GcY82oaMFCOBa/62/ZdXs3LsKbIepDzcma32bqO4onbQx95xZXoeCydZnh</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">etfsQ8JvPd1z2VCva0IpdrV6/xIXugmyqlVPO7SszljuGncqAV0ggmBBz1SECwsd</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">FSnp/9e43LQjtSF96F762chX35SKwEhvTnEcpZ2gJJyT+rsFF7xOpQ==</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">-----END RSA PRIVATE KEY-----</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">-----BEGIN CERTIFICATE-----</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">MIICjjCCAfegAwIBAgIBADANBgkqhkiG9w0BAQUFADBrMR8wHQYJKoZIhvcNAQkB</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">FhBiYWxhQHBzaWRhdGEuY29tMREwDwYDVQQKEwhwc2kgZGF0YTEMMAoGA1UECxMD</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">cHNpMQwwCgYDVQQHEwNibHIxDDAKBgNVBAgTA2thcjELMAkGA1UEBhMCaW4wHhcN</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">MDYwNjA3MDY1OTA3WhcNMDcwNjA3MDY1OTA3WjBrMR8wHQYJKoZIhvcNAQkBFhBi</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">YWxhQHBzaWRhdGEuY29tMREwDwYDVQQKEwhwc2kgZGF0YTEMMAoGA1UECxMDcHNp</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">MQwwCgYDVQQHEwNibHIxDDAKBgNVBAgTA2thcjELMAkGA1UEBhMCaW4wgZ8wDQYJ</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">KoZIhvcNAQEBBQADgY0AMIGJAoGBAKuGfVy/A45AhHeNy35gBcHOEFv3F+zAXfgK</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">qk0KLTBqx+BmuQ7pSGKLNsNdDlqU0WlppJ2caP9X7jLGFIPmt3I8OzD7KJlfdZjZ</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">voS5Qq4ukMcyQP0hOjAPuqE5/exLz9kbmYXiHZfN4yOWPCl6rzzJ4Q3uffMZYCEI</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">IZDivC0HAgMBAAGjQjBAMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgIkMBMGA1UdJQQM</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">MAoGCCsGAQUFBwMBMBEGCWCGSAGG+EIBAQQEAwIGQDANBgkqhkiG9w0BAQUFAAOB</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">gQCky3Ov2mUTgY6uNkbVTQWVFec7sDIrpaxwSVjbbwWA34tK3E7tqBiFJqQPPZDl</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">/cCmcYyeNvvMAr6YzC1U6P+nRuoAJ4sot14o01GmUS51QQpo+IjZs8ycBVkIXuZ9</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">LvlnELNZQa9Ea8IITX4MH0dFp0h5wTzYtrBuw/qRzLH5RA==</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">-----END CERTIFICATE-----</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">Thanks for your prompt response and hoping for a solution. </span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">Regards</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">Yesh.</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">-----Original Message-----<br>From: Aleksey Sanin [mailto: <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:aleksey@aleksey.com" target="_blank">
aleksey@aleksey.com</a>] <br>Sent: Friday, December 01, 2006 8:46 PM<br>To: yeshwanth.c<br>Cc: <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:xmlsec@aleksey.com" target="_blank">xmlsec@aleksey.com</a>
<br>Subject: Re: [xmlsec] Error signing the following xml document </span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">> While signing the following example xml document using the xmlsec libraries,
</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">Do you sign this document using xmlsec command line utility? What </span></font>
</p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">are the command line parameters? Or do you do it from the C code?</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">Can you share it?</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"> </span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">BTW, I noticed the disclaimer at the bottom of your emails. This is </span>
</font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">a public forum and the disclaimer does not make sense. Please, remove</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">it from your future posts.</span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"></span></font></p>
<p><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">Thanks,</span></font></p>
<div><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">Aleksey</span></font></div>
<div><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"></span></font><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt"></span></font> </div>
<div><font face="Courier New" size="2"><span style="FONT-SIZE: 10pt">
<p><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hi,</span></font></p>
<p><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span></font><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">While signing the following example xml document,
</span></font></p>
<p><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span></font><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font> </b></span><font face="Verdana" size="2">
<span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><span><font color="blue"><?</font></span><span><font color="blue">xml version="1.0" encoding="UTF-8" </font></span><span><font color="blue">?></font>
</span> </span></font></p>
<p style="MARGIN-LEFT: 12pt"><span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><a title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##"><b title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##">
<font title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##" face="Courier New" color="red"><span title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##" style="FONT-WEIGHT: bold; COLOR: red">
-</span></font></b></a> </span></font></span><span><font face="Verdana" color="blue" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><!--</span></font></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
</span></font><span><font face="Courier" color="#888888"></font></span></p><span><pre style="MARGIN-LEFT: 12pt"><font face="Courier New" color="#888888" size="2"><span style="FONT-SIZE: 10pt; COLOR: #888888">
</span></font></pre><pre style="MARGIN-LEFT: 12pt"><font face="Courier New" color="#888888" size="2"><span style="FONT-SIZE: 10pt; COLOR: #888888">XML Security Library example: Simple signature template file for sign1 example.
</span></font></pre></span>
<p style="TEXT-INDENT: -12pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue">--></font></span><span></span> </span></font></p>
<p style="TEXT-INDENT: -12pt"><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><a title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##"><b title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##">
<font title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##" face="Courier New" color="red"><span title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##" style="FONT-WEIGHT: bold; COLOR: red">
-</span></font></b></a> <span><font color="blue"><</font></span><span><font color="#990000">Envelope</font></span><span><font color="red"> xmlns</font></span><span><font color="blue"> ="</font></span><b><font color="red">
<span style="FONT-WEIGHT: bold; COLOR: red">urn:envelope</span></font></b><span><font color="blue">"></font></span></span></font></p>
<p style="TEXT-INDENT: -24pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"><</font></span><span><font color="#990000">Data</font></span><span><font color="blue">></font></span><span><b>Hello, World!</b></span><span> <font color="blue"></</font></span><span><font color="#990000">
Data</font></span><span><font color="blue">></font></span> </span></font></p>
<p style="TEXT-INDENT: -24pt"><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><a title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##"><b title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##">
<font title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##" face="Courier New" color="red"><span title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##" style="FONT-WEIGHT: bold; COLOR: red">
-</span></font></b></a> <span><font color="blue"><</font></span><span><font color="#990000">Signature</font></span><span><font color="red"> xmlns</font></span><span><font color="blue"> ="</font></span><b><font color="red">
<span style="FONT-WEIGHT: bold; COLOR: red"><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.w3.org/2000/09/xmldsig#" target="_blank">http://www.w3.org/2000/09/xmldsig#</a></span></font></b><span>
<font color="blue"> "></font></span></span></font></p>
<p style="TEXT-INDENT: -24pt"><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><a title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##"><b title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##">
<font title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##" face="Courier New" color="red"><span title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##" style="FONT-WEIGHT: bold; COLOR: red">
-</span></font></b></a> <span><font color="blue"><</font></span><span><font color="#990000">SignedInfo</font></span><span><font color="blue">></font></span></span></font></p>
<p style="TEXT-INDENT: -24pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"><</font></span><span><font color="#990000">CanonicalizationMethod</font></span> <span><font color="#990000">Algorithm</font></span><span><font color="blue"> ="</font></span><b><span style="FONT-WEIGHT: bold">
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" target="_blank">http://www.w3.org/TR/2001/REC-xml-c14n-20010315</a></span></b><span><font color="blue">" />
</font></span></span></font></p>
<p style="TEXT-INDENT: -24pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"><</font></span><span><font color="#990000">SignatureMethod</font></span> <span><font color="#990000">Algorithm</font></span><span><font color="blue"> ="</font></span><b><span style="FONT-WEIGHT: bold">
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.w3.org/2000/09/xmldsig#rsa-sha1" target="_blank">http://www.w3.org/2000/09/xmldsig#rsa-sha1</a></span></b><span><font color="blue">" /></font>
</span></span></font></p>
<p style="TEXT-INDENT: -24pt"><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><a title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##"><b title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##">
<font title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##" face="Courier New" color="red"><span title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##" style="FONT-WEIGHT: bold; COLOR: red">
-</span></font></b></a> <span><font color="blue"><</font></span><span><font color="#990000">Reference URI</font></span><span><font color="blue">=""></font></span></span></font> </p>
<p style="TEXT-INDENT: -24pt"><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><a title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##"><b title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##">
<font title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##" face="Courier New" color="red"><span title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##" style="FONT-WEIGHT: bold; COLOR: red">
-</span></font></b></a> <span><font color="blue"><</font></span><span><font color="#990000">Transforms</font></span><span><font color="blue">></font></span></span></font></p>
<p style="TEXT-INDENT: -24pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"><</font></span><span><font color="#990000">Transform</font></span> <span><font color="#990000">Algorithm</font></span><span><font color="blue">=" </font></span><b><span style="FONT-WEIGHT: bold">
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.w3.org/2000/09/xmldsig#enveloped-signature" target="_blank">http://www.w3.org/2000/09/xmldsig#enveloped-signature</a></span></b><span><font color="blue">
" /> </font></span></span></font></p>
<p style="TEXT-INDENT: -12pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"></</font></span><span><font color="#990000">Transforms</font></span><span><font color="blue">></font></span></span></font></p>
<p style="TEXT-INDENT: -24pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"><</font></span><span><font color="#990000">DigestMethod</font></span> <span><font color="#990000">Algorithm</font></span><span><font color="blue">=" </font></span><b><span style="FONT-WEIGHT: bold">
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.w3.org/2000/09/xmldsig#sha1" target="_blank">http://www.w3.org/2000/09/xmldsig#sha1</a></span></b><span><font color="blue">" /></font></span>
</span></font></p>
<p style="TEXT-INDENT: -24pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"><</font></span><span><font color="#990000">DigestValue</font></span> <span><font color="blue">/></font></span> </span></font></p>
<p style="TEXT-INDENT: -12pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"></</font></span><span><font color="#990000">Reference</font></span><span><font color="blue">></font></span></span></font></p>
<p style="TEXT-INDENT: -12pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"></</font></span><span><font color="#990000">SignedInfo</font></span><span><font color="blue">></font></span></span></font></p>
<p style="TEXT-INDENT: -24pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"><</font></span><span><font color="#990000">SignatureValue</font></span> <span><font color="blue">/></font></span> </span></font></p>
<p style="TEXT-INDENT: -24pt"><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><a title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##"><b title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##">
<font title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##" face="Courier New" color="red"><span title="file:///D:/yeshwanth/Yeshwanth/DLL/LicenseManager/LicenseGenerator/write.xml##" style="FONT-WEIGHT: bold; COLOR: red">
-</span></font></b></a> <span><font color="blue"><</font></span><span><font color="#990000">KeyInfo</font></span><span><font color="blue">></font></span></span></font></p>
<p style="TEXT-INDENT: -24pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"><</font></span><span><font color="#990000">KeyName</font></span> <span><font color="blue">/></font></span> </span></font></p>
<p style="TEXT-INDENT: -12pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"></</font></span><span><font color="#990000">KeyInfo</font></span><span><font color="blue">></font></span></span></font></p>
<p style="TEXT-INDENT: -12pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"></</font></span><span><font color="#990000">Signature</font></span><span><font color="blue">></font></span></span></font></p>
<p style="TEXT-INDENT: -12pt"><span><b><font face="Courier New" color="red" size="2"><span style="FONT-SIZE: 10pt"> </span></font></b></span><font face="Verdana" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
<span><font color="blue"></</font></span><span><font color="#990000">Envelope</font></span><span><font color="blue">></font></span></span></font></p>
<p style="TEXT-INDENT: -12pt"><span><font face="Verdana" color="blue" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">I I get the following error: -</span></font></span><span> <font face="Verdana" color="blue" size="2">
<span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> </span></font></span></p>
<p><span><font face="Verdana" color="blue" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><strong>func=xmlSecDSigCtxProcessSignatureNode:</strong></span></font></span></p>
<p><span><font face="Verdana" color="blue" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><strong>file=..\src\xmldsig.c:line=465:obj=unknow</strong></span></font></span><span> <font face="Verdana" color="blue" size="2">
<span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><strong>n:</strong></span></font></span></p>
<p><span><font face="Verdana" color="blue" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><strong>subj=dsigCtx->c14nMethod == NULL:</strong></span></font></span></p>
<p><span><font face="Verdana" color="blue" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><strong>error=100:assertion:</strong></span></font></span></p>
<p><span><font face="Verdana" color="blue" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><strong>func=xmlSecDSigCtxSign:file=..\src\xmldsig.c:</strong></span></font></span></p>
<p><span><font face="Verdana" color="blue" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><strong>line=303:obj=unknown:subj=xmlSecDSi</strong></span></font></span><span> <font face="Verdana" color="blue" size="2">
<span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><strong>gCtxSigantureProcessNode:</strong></span></font></span></p>
<p><span><font face="Verdana" color="blue" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><strong>error=1:xmlsec library function failed:</strong></span></font></span></p>
<p><span><font face="Verdana" color="blue" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><strong>Error: signature failed</strong></span></font></span></p>
<p><span><font face="Verdana" color="blue" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> </span></font></span><span><font face="Verdana" color="blue" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
Please could somebody help me out with this?</span></font></span></p>
<p><span><font face="Verdana" color="blue" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> </span></font></span><span><font face="Verdana" color="blue" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
Thanks in advance,</span></font></span></p>
<p><span><font face="Verdana" color="blue" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">Yesh.</span></font></span></p>
<p style="TEXT-INDENT: -12pt"><span><font face="Verdana" color="blue" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> </span></font></span></p></span></font></div></blockquote></div><br>