Hi! I tested the xmlsec with the following 2 examples:
1. <?xml version="1.0" encoding="UTF-8"?> <Envelope xmlns="urn:envelope"> <Signature xmlns="http://www.w3.org/2000/09/xmldsig#"> <SignedInfo> <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /> <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /> <Reference URI="file:///weather.xml#KSFO"> <Transforms> </Transforms> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> <DigestValue></DigestValue> </Reference> </SignedInfo> <SignatureValue/> <KeyInfo> <KeyValue/> </KeyInfo> </Signature> </Envelope> 2. <?xml version="1.0" encoding="UTF-8"?> <Envelope xmlns="urn:envelope"> <Signature xmlns="http://www.w3.org/2000/09/xmldsig#"> <SignedInfo> <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /> <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /> <Reference URI="file:///weather.xml"> <Transforms> </Transforms> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> <DigestValue></DigestValue> </Reference> </SignedInfo> <SignatureValue/> <KeyInfo> <KeyValue/> </KeyInfo> </Signature> </Envelope> The reference is the only thing that is different: 1. <Reference URI="file:///weather.xml#KSFO"> 2. <Reference URI="file:///weather.xml"> The weather.xml looks like the following: ?xml version="1.0" encoding="UTF-8"?> <document> <header> <title>The latest weather</title> </header> <content> <weather Id="KMRY"> <location> Monterey, Monterey Peninsula Airport, CA, United States (KMRY) 36-35-26N 121-50-51W 66M </location> <time> Apr 19, 2002 - 10:54 AM EST / 2002.04.19 1554 UTC </time> <wind> from the WNW (300 degrees) at 6 MPH (5 KT) </wind> <visibility> 10 mile(s) </visibility> <sky> clear </sky> <temperature> 54.0 F (12.2 C) </temperature> <dewpt> 46.0 F (7.8 C) </dewpt> <humidity> 74% </humidity> <press> 30.15 in. Hg (1020 hPa) </press> <!-- KMRY 191554Z 30005KT 10SM CLR 12/08 A3015 RMK AO2 SLP223 T01220078 --> <!-- 16 --> </weather> <weather Id="KSFO"> <location> San Francisco, San Francisco International Airport, CA, United States (KSFO) 37-37-11N 122-21-53W 26M </location> <time> Apr 19, 2002 - 10:56 AM EST / 2002.04.19 1556 UTC </time> <wind> from the W (260 degrees) at 5 MPH (4 KT) </wind> <visibility> 10 mile(s) </visibility> <sky> clear </sky> <temperature> 55.9 F (13.3 C) </temperature> <dewpt> 39.0 F (3.9 C) </dewpt> <humidity> 52% </humidity> <press> 30.15 in. Hg (1020 hPa) </press> <!-- KSFO 191556Z 26004KT 10SM CLR 13/04 A3015 RMK AO2 SLP211 T01330039 --> <!-- 16 --> </weather> <weather Id="KMVY"> <location> Vineyard Haven, Marthas Vineyard Airport, MA, United States (KMVY) 41-23-32N 070-37-00W 16M </location> <time> Apr 19, 2002 - 10:53 AM EST / 2002.04.19 1553 UTC </time> <wind> from the S (170 degrees) at 9 MPH (8 KT) </wind> <visibility> 6 mile(s) </visibility> <sky> overcast </sky> <note> haze </note> <temperature> 55.0 F (12.8 C) </temperature> <dewpt> 48.9 F (9.4 C) </dewpt> <humidity> 79% </humidity> <press> 30 in. Hg (1015 hPa) </press> <!-- KMVY 191553Z 17008KT 6SM HZ OVC005 13/09 A3000 RMK AO2 SLP159 T01280094 --> <!-- 16 --> </weather> </content> </document> So my problem is the following: Example 2 works but example 1 does not work. I get the following error: func=xmlSecXPathDataExecute:file=..\src\xpath.c:line=273:obj=unknown:subj=xm lXPt rEval:error=5:libxml2 library function failed:expr=xpointer(id('KSFO')) func=xmlSecXPathDataListExecute:file=..\src\xpath.c:line=356:obj=unknown:sub j=xm lSecXPathDataExecute:error=1:xmlsec library function failed: func=xmlSecTransformXPathExecute:file=..\src\xpath.c:line=466:obj=xpointer:s ubj= xmlSecXPathDataExecute:error=1:xmlsec library function failed: func=xmlSecTransformDefaultPushXml:file=..\src\transforms.c:line=2332:obj=xp oint er:subj=xmlSecTransformExecute:error=1:xmlsec library function failed: func=xmlSecParserPushBin:file=..\src\parser.c:line=222:obj=xml-parser:subj=x mlSe cTransformPushXml:error=1:xmlsec library function failed: func=xmlSecTransformPump:file=..\src\transforms.c:line=1595:obj=xml-parser:s ubj= xmlSecTransformPushBin:error=1:xmlsec library function failed: func=xmlSecTransformCtxUriExecute:file=..\src\transforms.c:line=1121:obj=unk nown :subj=xmlSecTransformPump:error=1:xmlsec library function failed:uri=file:///wea ther.xml func=xmlSecTransformCtxExecute:file=..\src\transforms.c:line=1241:obj=unknow n:su bj=xmlSecTransformCtxUriExecute:error=1:xmlsec library function failed: func=xmlSecDSigReferenceCtxProcessNode:file=..\src\xmldsig.c:line=1564:obj=u nkno wn:subj=xmlSecTransformCtxExecute:error=1:xmlsec library function failed: func=xmlSecDSigCtxProcessSignedInfoNode:file=..\src\xmldsig.c:line=804:obj=u nkno wn:subj=xmlSecDSigReferenceCtxProcessNode:error=1:xmlsec library function failed :node=Reference func=xmlSecDSigCtxProcessSignatureNode:file=..\src\xmldsig.c:line=547:obj=un know n:subj=xmlSecDSigCtxProcessSignedInfoNode:error=1:xmlsec library function failed : func=xmlSecDSigCtxSign:file=..\src\xmldsig.c:line=303:obj=unknown:subj=xmlSe cDSi gCtxSigantureProcessNode:error=1:xmlsec library function failed: Error: signature failed Error: failed to sign file "test.xml" So my question is: Why does the xmlsec not work with a #reference? Best regards Jan-Olof Andersson Email: [EMAIL PROTECTED] Home: +56 2 689 3620 Fax / Office Home: +56 2 689 1689 Cellular: +56 9 779 1567 Phone Sweden: +46 521 30714 MSN / Netmeeting / video: [EMAIL PROTECTED] _______________________________________________ xmlsec mailing list [EMAIL PROTECTED] http://www.aleksey.com/mailman/listinfo/xmlsec
