Rotiman, Moisés rotimanrj@yahoo.com.br [delphi-programming]
2016-04-14 15:48:02 UTC
Pessoal, boa tarde
Estou quebrando a cabeça com a assinatura de um XML, que esta retornando o erro:
The signature property must be set before calling this method
Sendo que tenho um arquivo XML de exemplo que ao mandar assinar funciona direitinho, mas o outro infelizmente não funciona:
Exemplo de XML com a Signature , que funciona:
<evento id="1">Â <eFinanceira xmlns="http://www.eFinanceira.gov.br/schemas/evtCadDeclarante/v1_0_0">Â Â <evtCadDeclarante Id="ID00000000003">Â Â Â <ideEvento>Â Â Â Â <indRetificacao>1</indRetificacao>Â Â Â Â <tpAmb>1</tpAmb>Â Â Â Â <aplicEmi>1</aplicEmi>Â Â Â Â <verAplic>13.01.02</verAplic>Â Â Â </ideEvento>Â Â Â <ideDeclarante>Â Â Â Â <cnpjDeclarante>32500613000184</cnpjDeclarante>Â Â Â </ideDeclarante>Â Â Â <infoCadastro>Â Â Â Â <GIIN>000000.00000.XX.001</GIIN>Â Â Â Â <Nome>CAIXA BENEFICENTE DOS EMPREGADOS DA COMPANHIA SIDERURGICA NACIONAL</Nome>Â Â Â Â <EnderecoLivre>RUA GETULIO VARGAS - 32 - 7ANDAR - BAIRRO - 99999999</EnderecoLivre>Â Â Â Â <Municipio>3550308</Municipio>Â Â Â Â <UF>SP</UF>Â Â Â Â <Pais>BR</Pais>Â Â Â Â <paisResidencia>BR</paisResidencia>Â Â Â </infoCadastro>Â Â </evtCadDeclarante>Â <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="">Â Â Â <Transforms>Â Â Â Â <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>Â Â Â Â <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>Â Â Â </Transforms>Â Â Â <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>Â Â Â <DigestValue></DigestValue>Â Â </Reference>Â Â </SignedInfo>Â Â Â <SignatureValue></SignatureValue>Â </Signature>Â </eFinanceira></evento>
Meu exemplo que infelizmente esta dando o erro mandei somente o o pedaço da Signature, que ao comparar esta identifca.
 </loteEventos>   <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="">     <Transforms>      <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>      <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>     </Transforms>     <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>     <DigestValue/>    </Reference>   </SignedInfo>   <SignatureValue/>  </Signature></eFinanceira>
Obrigado pela força Moises Rotiman
"E conhecereis a verdade, e a verdade vos libertará." - João 8:32
Estou quebrando a cabeça com a assinatura de um XML, que esta retornando o erro:
The signature property must be set before calling this method
Sendo que tenho um arquivo XML de exemplo que ao mandar assinar funciona direitinho, mas o outro infelizmente não funciona:
Exemplo de XML com a Signature , que funciona:
<evento id="1">Â <eFinanceira xmlns="http://www.eFinanceira.gov.br/schemas/evtCadDeclarante/v1_0_0">Â Â <evtCadDeclarante Id="ID00000000003">Â Â Â <ideEvento>Â Â Â Â <indRetificacao>1</indRetificacao>Â Â Â Â <tpAmb>1</tpAmb>Â Â Â Â <aplicEmi>1</aplicEmi>Â Â Â Â <verAplic>13.01.02</verAplic>Â Â Â </ideEvento>Â Â Â <ideDeclarante>Â Â Â Â <cnpjDeclarante>32500613000184</cnpjDeclarante>Â Â Â </ideDeclarante>Â Â Â <infoCadastro>Â Â Â Â <GIIN>000000.00000.XX.001</GIIN>Â Â Â Â <Nome>CAIXA BENEFICENTE DOS EMPREGADOS DA COMPANHIA SIDERURGICA NACIONAL</Nome>Â Â Â Â <EnderecoLivre>RUA GETULIO VARGAS - 32 - 7ANDAR - BAIRRO - 99999999</EnderecoLivre>Â Â Â Â <Municipio>3550308</Municipio>Â Â Â Â <UF>SP</UF>Â Â Â Â <Pais>BR</Pais>Â Â Â Â <paisResidencia>BR</paisResidencia>Â Â Â </infoCadastro>Â Â </evtCadDeclarante>Â <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="">Â Â Â <Transforms>Â Â Â Â <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>Â Â Â Â <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>Â Â Â </Transforms>Â Â Â <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>Â Â Â <DigestValue></DigestValue>Â Â </Reference>Â Â </SignedInfo>Â Â Â <SignatureValue></SignatureValue>Â </Signature>Â </eFinanceira></evento>
Meu exemplo que infelizmente esta dando o erro mandei somente o o pedaço da Signature, que ao comparar esta identifca.
 </loteEventos>   <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="">     <Transforms>      <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>      <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>     </Transforms>     <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>     <DigestValue/>    </Reference>   </SignedInfo>   <SignatureValue/>  </Signature></eFinanceira>
Obrigado pela força Moises Rotiman
"E conhecereis a verdade, e a verdade vos libertará." - João 8:32