[xmlsec] libxmlsec1: sign specific elements of SOAP message

Grünwald, Stefan S.Gruenwald at cashpoint.com
Wed Aug 29 00:30:25 PDT 2018



Hi,



I would like to sign specific parts of my SOAP message.

Therefore for example I added an Id attribute to my message body



<ns0:Body ns4:Id="id-d27b22e6-7bf5-46de-9d3c-66d04a209827">



I also create a reference element containing the xpointer as an URI.



xmlNodePtr refNode = xmlSecTmplSignatureAddReference(signNode,

xmlSecTransformSha256Id, NULL, reinterpret_cast<const

unsigned char *>("#id-d27b22e6-7bf5-46de-9d3c-66d04a209827"), NULL);



But I get this error:



func=xmlSecXPathDataExecute:file=xpath.c:line=247:obj=unknown:subj=xml

XPtrEval:error=5:libxml2

library function

failed:expr=xpointer(id('id-d27b22e6-7bf5-46de-9d3c-66d04a209827'));

xml

error: 0: NULL



Unfortunately I couldn’t find any example for doing such a thing.



I also started debugging into libxmlsec1 and libxml2 to know a bit

more about that but coming into libxml2 it gets quite complicated.

I guess I’m doing something wrong with the xpointer because I also

tried a simple xpointer example in libxml2 and couldn’t get a proper result.

Maybe you have some advice for me what I’m doing wrong or at least

what I should try next.



Thanks in advance!



Best regards,



Stefan


Mit freundlichen Grüßen / Best regards,

Stefan Grünwald
Teamleader Development Bold

CASHPOINT Agentur & IT-Service GmbH
Viktor Kaplan Str. 9, 2201 Gerasdorf, AUSTRIA

Phone +43 1 21772 1312
Fax +43 (1) 7347330
s.gruenwald at cashpoint.com<mailto:s.gruenwald at cashpoint.com>
www.cashpoint.com<https://www.cashpoint.com>

FN: 146190k, FB-Gericht: Landesgericht Korneuburg

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.aleksey.com/pipermail/xmlsec/attachments/20180829/41e7bd55/attachment.html>


More information about the xmlsec mailing list