[xmlsec] libxmlsec1: sign specific elements of SOAP message

Aleksey Sanin aleksey at aleksey.com
Wed Aug 29 09:00:05 PDT 2018


Section 3.2 from the FAQ

Aleksey

On 8/29/18 12:30 AM, Grünwald, Stefan wrote:
> 
> 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,
> *
> StefanGrünwald
> *Teamleader Development Bold
> 
> CASHPOINT Agentur & IT-Service GmbH
> Viktor Kaplan Str. 9, 2201Gerasdorf, 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
> 
> 
> 
> 
> _______________________________________________
> xmlsec mailing list
> xmlsec at aleksey.com
> http://www.aleksey.com/mailman/listinfo/xmlsec
> 


More information about the xmlsec mailing list