1057 Rejection: Signature differs from calculated

Asked

Viewed 549 times

0

I am trying to use the Nfse/Nfsesp.class.php example from nfephp-org and I’m getting the following feedback:

<PedidoEnvioRPS xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.prefeitura.sp.gov.br/nfe" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Cabecalho xmlns="" Versao="1">
    <CPFCNPJRemetente>
    <CNPJ>00000000000000</CNPJ>
    </CPFCNPJRemetente>
</Cabecalho>
<RPS xmlns="">
    <Assinatura>
        ...
    </Assinatura>
    <ChaveRPS>
        <InscricaoPrestador>92038497</InscricaoPrestador>
        <SerieRPS>AAAAA</SerieRPS>
        <NumeroRPS>1</NumeroRPS>
    </ChaveRPS>
    <TipoRPS>RPS</TipoRPS>
    <DataEmissao>2015-12-09</DataEmissao>
    <StatusRPS>N</StatusRPS>
    <TributacaoRPS>T</TributacaoRPS>
    <ValorServicos>1</ValorServicos>
    <ValorDeducoes>0</ValorDeducoes>
    <CodigoServico>07498</CodigoServico>
    <AliquotaServicos>0.05</AliquotaServicos>
    <ISSRetido>false</ISSRetido>
    <CPFCNPJTomador>
        <CPF>36674391212</CPF>
    </CPFCNPJTomador>
    <RazaoSocialTomador>Joao Silva Santos</RazaoSocialTomador>
    <EnderecoTomador>
    <TipoLogradouro>Rua</TipoLogradouro>
    <Logradouro>Cuiate</Logradouro>
    <NumeroEndereco>196</NumeroEndereco>
    <ComplementoEndereco>Vila Operaria</ComplementoEndereco>
    <Bairro>Jardim Sao Paulo</Bairro>
    <Cidade>3550308</Cidade>
    <UF>SP</UF>
    <CEP>08411500</CEP>
    </EnderecoTomador>
    <EmailTomador>[email protected]</EmailTomador>
    <Discriminacao>Teste de geracao de NFSe via sistema proprio</Discriminacao>
</RPS>
<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>EhF55XYIO9a4LKL9cWlG6nHIz/4=</DigestValue>
        </Reference>
    </SignedInfo>
    <SignatureValue>
        ...
    </SignatureValue>
    <KeyInfo>
        <X509Data>
            <X509Certificate>
                ...
            </X509Certificate>
        </X509Data>
    </KeyInfo>
</Signature>

I’ve been at it for days and the answers I’ve seen, I’ve done but so far nothing has worked or wasn’t the case.

Does anyone have any idea how to solve this?

  • Where is the part of XML that goes the information of the digital cerificado?

  • Oops, evil I pasted wrong. Ready updated.

  • Most likely something with the certificate. Is it valid? Isn’t it expired? Have you used it for something similar?

  • I’m trying to send to SP, the city code was already in the example, I didn’t think to check it... I’ll see...

  • Yes, the certificate is valid and not expired

  • 3550308 is the municipality of São Paulo itself.

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.