Hello,<br>In <a href="http://www.aleksey.com/xmlsec/api/xmlsec-examples-sign-x509.html">http://www.aleksey.com/xmlsec/api/xmlsec-examples-sign-x509.html</a><br><br>Before siging a node,<br><br><pre class="PROGRAMLISTING"> /* load private key, assuming that there is not password */<br>
dsigCtx->signKey = xmlSecCryptoAppKeyLoad(key_file, xmlSecKeyDataFormatPem, NULL, NULL, NULL);<br> if(dsigCtx->signKey == NULL) {<br> fprintf(stderr,"Error: failed to load private pem key from \"%s\"\n", key_file);<br>
        goto done;<br> }<br> <br> /* load certificate and add to the key */<br> if(xmlSecCryptoAppKeyCertLoad(dsigCtx->signKey, cert_file, xmlSecKeyDataFormatPem) < 0) {<br> fprintf(stderr,"Error: failed to load pem certificate \"%s\"\n", cert_file);<br>
        goto done;<br> }</pre><br>I wonder whether the second step (load certificate) is needed for signing? In principle, private key is enough, right? I also test with loading certificate and without loading certificate, both signature can be verified.<br>
<br>Appretiate in advance<br><br>Weizhong<br>