Discussion:
[xmlsec] libxmlsec1: sign specific elements of SOAP message
Grünwald, Stefan
2018-08-29 07:30:25 UTC
Permalink
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
***@cashpoint.com<mailto:***@cashpoint.com>
www.cashpoint.com<https://www.cashpoint.com>

FN: 146190k, FB-Gericht: Landesgericht Korneuburg
Aleksey Sanin
2018-08-29 16:00:05 UTC
Permalink
Section 3.2 from the FAQ

Aleksey
Post by Grünwald, Stefan
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);
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
www.cashpoint.com <https://www.cashpoint.com>
FN: 146190k, FB-Gericht: Landesgericht Korneuburg
_______________________________________________
xmlsec mailing list
http://www.aleksey.com/mailman/listinfo/xmlsec
Loading...