<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Thank You Aleksey,<div><br></div><div>When you say to check xmlsec help , are you talking about this?</div><div><a href="https://www.aleksey.com/xmlsec/xmlsec-man.html" target="_blank">https://www.aleksey.com/xmlsec/xmlsec-man.html</a></div><div><br></div><div>If is true, how can I point to a start node?</div><div>I try </div><div><div>>xmlsec --sign --node-name LoteRps file.xml > file_sign.xml</div><div><br></div><div>But I get the error:</div><div>Error: failed to find node with name="LoteRps"</div><div>Error: failed to load template "file.xml"</div><div>Error: failed to sign file "file.xml"</div></div><div><br></div><div>Sorry for anything but I'm really aimlessly with this problem.</div><div><br></div><div>Joao</div><br><div>> Subject: Re: [xmlsec] Error xpointer(id('XXXXXXX')) again<br>> To: juaumkiko@msn.com; xmlsec@aleksey.com<br>> From: aleksey@aleksey.com<br>> Date: Tue, 15 Sep 2015 09:27:06 -0700<br>> <br>> The error talks about expr=xpointer(id('1332') thus it is trying<br>> to sign that Reference and there is no DTD for it.<br>> <br>> By default, xmlsec utility signs the first Signature node it finds.<br>> Check xmlsec help to find out how to point it to any start node.<br>> <br>> Best,<br>> <br>> Aleksey<br>> <br>> On 9/15/15 9:23 AM, Joćo Henrique Souza wrote:<br>> > Aleksey,<br>> > Thanks again.<br>> > <br>> > But if you realize in the XML which I sent before, it has Two Tags of<br>> > Signature. I'm trying to sign the second one.<br>> > <br>> > When you say about the:<br>> > <Reference URI="#1332"><br>> > <InfRps Id="1332"><br>> > It's about the first Signature which I'd already done with sucess.<br>> > Please see the XML<br>> > <br>> > And when you say about the DTC:<br>> > <!DOCTYPE test [<!ATTLIST LoteRps Id ID #IMPLIED>]><br>> > This is about the Signature which I'm trying to make. In the XML, see<br>> > the last Signature's Tags. They are empty.<br>> > <br>> > Have a way to specify the DTC in a way to sign the two tag groups<br>> > (InfRps and LoteRps) with a single step?<br>> > <br>> > Thanks Again and sorry if I can't see (yet) what you are trying to<br>> > explain me.<br>> > Joao<br>> > <br>> >> Subject: Re: [xmlsec] Error xpointer(id('XXXXXXX')) again<br>> >> To: juaumkiko@msn.com; xmlsec@aleksey.com<br>> >> From: aleksey@aleksey.com<br>> >> Date: Tue, 15 Sep 2015 08:22:38 -0700<br>> >><br>> >><br>> > func=xmlSecXPathDataExecute:file=..\src\xpath.c:line=273:obj=unknown:subj=xmlXPtrEval:error=5:libxml2<br>> >> library function failed:expr=xpointer(id('1332'))<br>> >><br>> >> <Reference URI="#1332"><br>> >><br>> >> <InfRps Id="1332"><br>> >><br>> >> <!DOCTYPE test [<!ATTLIST LoteRps Id ID #IMPLIED>]><br>> >><br>> >> Aleksey<br>> >><br>> >> On 9/15/15 4:08 AM, Joćo Henrique Souza wrote:<br>> >> > Hello Aleksey,<br>> >> ><br>> >> > Before anything else... Thank you so much for spend your time with my<br>> >> > question.<br>> >> > About you answer, I couldn't understand.<br>> >> ><br>> >> > I already sign the URI 1332 (InfRps Node ).<br>> >> > Now I need to sign URI 133 (LoteRps Node ).<br>> >> ><br>> >> > I realize that if I try to sign the LoteRps Node without the Signature<br>> >> > TAGS of URI 1332 (already signed), the signature process occurs without<br>> >> > problem. But that don't solve my problem. What I need is first to sign<br>> >> > the InfRps Node and after the LoteRps node.<br>> >> ><br>> >> > Thank you in advance, again, any other hint.<br>> >> ><br>> >> > Joao Henrique<br>> >> ><br>> >> >> Subject: Re: [xmlsec] Error xpointer(id('XXXXXXX')) again<br>> >> >> To: juaumkiko@msn.com; xmlsec@aleksey.com<br>> >> >> From: aleksey@aleksey.com<br>> >> >> Date: Mon, 14 Sep 2015 13:36:33 -0700<br>> >> >><br>> >> >> <Reference URI="#1332"><br>> >> >><br>> >> >> <InfRps Id="1332"><br>> >> >><br>> >> >> <!ATTLIST LoteRps Id ID #IMPLIED><br>> >> >><br>> >> >> Aleksey<br>> >> >><br>> >> >> On 9/14/15 12:57 PM, Joćo Henrique Souza wrote:<br>> >> >> > Hello,<br>> >> >> > I've trying to sign a XML which already has a signed node.<br>> >> >> > I've already read the Faq Section and the other emails with the same<br>> >> >> > subject, but this unfortunatelly didn't solve my problem.<br>> >> >> ><br>> >> >> > The XML (node LoteRps) which I've been trying to sign is this (I'm a<br>> >> >> > Brazilian, so the XML is in my home language):<br>> >> >> ><br>> >> >> > <!DOCTYPE test [<!ATTLIST LoteRps Id ID #IMPLIED>]><br>> >> >> > <GerarNfseEnvio xmlns="http://www.abrasf.org.br/nfse.xsd"><br>> >> >> > <LoteRps Id="133" versao="1.00"><br>> >> >> > <NumeroLote>133</NumeroLote><br>> >> >> > <Cnpj>04220031000100</Cnpj><br>> >> >> > <InscricaoMunicipal>25252525</InscricaoMunicipal><br>> >> >> > <QuantidadeRps>1</QuantidadeRps><br>> >> >> > <ListaRps><br>> >> >> > <Rps><br>> >> >> > <InfRps Id="1332"><br>> >> >> > <IdentificacaoRps><br>> >> >> > <Numero>133</Numero><br>> >> >> > <Serie>2</Serie><br>> >> >> > <Tipo>1</Tipo><br>> >> >> > </IdentificacaoRps><br>> >> >> > <DataEmissao>2015-09-11T00:00:00</DataEmissao><br>> >> >> > <NaturezaOperacao>1</NaturezaOperacao><br>> >> >> > <RegimeEspecialTributacao>2</RegimeEspecialTributacao><br>> >> >> > <OptanteSimplesNacional>2</OptanteSimplesNacional><br>> >> >> > <IncentivadorCultural>2</IncentivadorCultural><br>> >> >> > <Status>1</Status><br>> >> >> > <Servico><br>> >> >> > <Valores><br>> >> >> > <ValorServicos>35.00</ValorServicos><br>> >> >> > <IssRetido>2</IssRetido><br>> >> >> > <ValorIss>1.75</ValorIss><br>> >> >> > <BaseCalculo>35.00</BaseCalculo><br>> >> >> > <Aliquota>5.0000</Aliquota><br>> >> >> > <ValorLiquidoNfse>35.00</ValorLiquidoNfse><br>> >> >> > </Valores><br>> >> >> > <ItemListaServico>11.01</ItemListaServico><br>> >> >> > <CodigoCnae>5210</CodigoCnae><br>> >> >> ><br>> >> >> > <CodigoTributacaoMunicipio>11010011</CodigoTributacaoMunicipio><br>> >> >> > <Discriminacao>ROTATIVS</Discriminacao><br>> >> >> > <CodigoMunicipio>4314902</CodigoMunicipio><br>> >> >> > </Servico><br>> >> >> > <Prestador><br>> >> >> > <Cnpj>04220031000100</Cnpj><br>> >> >> > <InscricaoMunicipal>25252525</InscricaoMunicipal><br>> >> >> > </Prestador><br>> >> >> > <Tomador><br>> >> >> > <RazaoSocial>NAO INFORMADO</RazaoSocial><br>> >> >> > <Endereco><br>> >> >> > <Endereco>-</Endereco><br>> >> >> > <Numero>-</Numero><br>> >> >> > <Bairro>-</Bairro><br>> >> >> > <CodigoMunicipio>4314902</CodigoMunicipio><br>> >> >> > <Uf>RS</Uf><br>> >> >> > <Cep>0</Cep><br>> >> >> > </Endereco><br>> >> >> > </Tomador><br>> >> >> > </InfRps><br>> >> >> > <Signature xmlns="http://www.w3.org/2000/09/xmldsig#"<br>> >> >> > Id="Ass_1332"><br>> >> >> > <SignedInfo><br>> >> >> > <CanonicalizationMethod<br>> >> >> > Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><br>> >> >> > <SignatureMethod<br>> >> >> > Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><br>> >> >> > <Reference URI="#1332"><br>> >> >> > <Transforms><br>> >> >> > <Transform<br>> >> >> > Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><br>> >> >> > <Transform<br>> >> >> > Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><br>> >> >> > </Transforms><br>> >> >> > <DigestMethod<br>> >> >> > Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><br>> >> >> > <DigestValue>QRTdVOZ2MdM5iTlIpHA13EHtMOQ=</DigestValue><br>> >> >> > </Reference><br>> >> >> > </SignedInfo><br>> >> >> ><br>> >> >> ><br>> >> ><br>> > <SignatureValue>K3YMZ97ZUyaH/LpQI+gUULMc+NB9a+rHoSFZL78OoKLn+fs4l1jqjMsE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z6oxD3y9LBIb9EJ63cEAr+2fBmCNIxoiMIIiIR18Rg7RpFusKF2a1kYoRqvpOwUyvUAHoNyTqg4GGbbqNMtARP</X509Certificate><br>> >> >> > </X509Data><br>> >> >> > </KeyInfo><br>> >> >> > </Signature><br>> >> >> > </Rps><br>> >> >> > </ListaRps><br>> >> >> > </LoteRps><br>> >> >> > <Signature xmlns="http://www.w3.org/2000/09/xmldsig#"<br>> > Id="AssLote_133"><br>> >> >> > <SignedInfo><br>> >> >> > <CanonicalizationMethod<br>> >> >> > Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><br>> >> >> > <SignatureMethod<br>> >> >> > Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><br>> >> >> > <Reference URI="#133"><br>> >> >> > <Transforms><br>> >> >> > <Transform<br>> >> >> > Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /><br>> >> >> > <Transform<br>> >> >> > Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><br>> >> >> > </Transforms><br>> >> >> > <DigestMethod<br>> >> >> > Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><br>> >> >> > <DigestValue></DigestValue><br>> >> >> > </Reference><br>> >> >> > </SignedInfo><br>> >> >> > <SignatureValue></SignatureValue><br>> >> >> > <KeyInfo><br>> >> >> > <X509Data><br>> >> >> > <X509Certificate></X509Certificate><br>> >> >> > </X509Data><br>> >> >> > </KeyInfo><br>> >> >> > </Signature><br>> >> >> > </GerarNfseEnvio><br>> >> >> ><br>> >> >> ><br>> >> >> > The error message that I receive is this:<br>> >> >> ><br>> >> >> ><br>> >> ><br>> > func=xmlSecXPathDataExecute:file=..\src\xpath.c:line=273:obj=unknown:subj=xmlXPtrEval:error=5:libxml2<br>> >> >> > library function failed:expr=xpointer(id('1332'))<br>> >> >> ><br>> >> ><br>> > func=xmlSecXPathDataListExecute:file=..\src\xpath.c:line=356:obj=unknown:subj=xmlSecXPathDataExecute:error=1:xmlsec<br>> >> >> > library function failed:<br>> >> >> ><br>> >> ><br>> > func=xmlSecTransformXPathExecute:file=..\src\xpath.c:line=466:obj=xpointer:subj=xmlSecXPathDataExecute:error=1:xmlsec<br>> >> >> > library function failed:<br>> >> >> ><br>> >> ><br>> > func=xmlSecTransformDefaultPushXml:file=..\src\transforms.c:line=2371:obj=xpointer:subj=xmlSecTransformExecute:error=1:xmlsec<br>> >> >> > library function failed:<br>> >> >> ><br>> >> ><br>> > func=xmlSecTransformCtxXmlExecute:file=..\src\transforms.c:line=1207:obj=unknown:subj=xmlSecTransformPushXml:error=1:xmlsec<br>> >> >> > library function failed:transform=xpointer<br>> >> >> ><br>> >> ><br>> > func=xmlSecTransformCtxExecute:file=..\src\transforms.c:line=1267:obj=unknown:subj=xmlSecTransformCtxXmlExecute:error=1:xmlsec<br>> >> >> > library function failed:<br>> >> >> ><br>> >> ><br>> > func=xmlSecDSigReferenceCtxProcessNode:file=..\src\xmldsig.c:line=1568:obj=unknown:subj=xmlSecTransformCtxExecute:error=1:xmlsec<br>> >> >> > library function failed:<br>> >> >> ><br>> >> ><br>> > func=xmlSecDSigCtxProcessSignedInfoNode:file=..\src\xmldsig.c:line=804:obj=unknown:subj=xmlSecDSigReferenceCtxProcessNode:error=1:xmlsec<br>> >> >> > library function failed:node=Reference<br>> >> >> ><br>> >> ><br>> > func=xmlSecDSigCtxProcessSignatureNode:file=..\src\xmldsig.c:line=547:obj=unknown:subj=xmlSecDSigCtxProcessSignedInfoNode:error=1:xmlsec<br>> >> >> > library function failed:<br>> >> >> ><br>> >> ><br>> > func=xmlSecDSigCtxSign:file=..\src\xmldsig.c:line=303:obj=unknown:subj=xmlSecDSigCtxSigantureProcessNode:error=1:xmlsec<br>> >> >> > library function failed:<br>> >> >> > Error: signature failed<br>> >> >> ><br>> >> >> > Thanks in advance for any help<br>> >> >> ><br>> >> >> > Joao Henrique<br>> >> >> ><br>> >> >> ><br>> >> >> > _______________________________________________<br>> >> >> > xmlsec mailing list<br>> >> >> > xmlsec@aleksey.com<br>> >> >> > http://www.aleksey.com/mailman/listinfo/xmlsec<br>> >> >> ><br>> >> ><br>> >> ><br>> >> > _______________________________________________<br>> >> > xmlsec mailing list<br>> >> > xmlsec@aleksey.com<br>> >> > http://www.aleksey.com/mailman/listinfo/xmlsec<br>> >> ><br></div> </div></body>
</html>