I am using the command line tool to successfully sign a template file. A
dotnet soap service successfully processes the sign.xml file. 

        xmlsec --sign --print-debug --privkey-der pk.der --output
sign.xml vstsout.xml

I am now trying the same thing in code with exactly the same files but
the signature fails. I based this on the sample "sign1.c". However I
notice the command line source uses a quite different approach (e.g. a
keymanager instance). Before I delve into that, is there anything
obviously missing here?

        doc = xmlParseFile("vstsout.xml");
        node = xmlSecFindNode(xmlDocGetRootElement(doc),
xmlSecNodeSignature, xmlSecDSigNs);
      dsigCtx = xmlSecDSigCtxCreate(NULL);
      dsigCtx->signKey = xmlSecCryptoAppKeyLoad("pk.der",
xmlSecKeyDataFormatDer, NULL, NULL, NULL);
      xmlSecKeySetName(dsigCtx->signKey, BAD_CAST "pk-der");

      xmlSecDSigCtxSign(dsigCtx, node);   <<<<<<-------- the signature
fails

Thanks muchly
Bruce 

**********************************************************************
IMPORTANT
        The information transmitted is for the use of the intended
recipient only and may contain confidential and/or legally
privileged material. Any review, re-transmission, disclosure,
dissemination or other use of, or taking of any action in
reliance upon, this information by persons or entities other
than the intended recipient is prohibited and may result in
severe penalties. If you have received this e-mail in error
please notify the Privacy Hotline of the Australian Taxation
Office, telephone 13 2869 and delete all copies of this
transmission together with any attachments.
**********************************************************************
_______________________________________________
xmlsec mailing list
[email protected]
http://www.aleksey.com/mailman/listinfo/xmlsec

Reply via email to