Nfse - Standard São Paulo and Blumenau, problem with error 1057 and signature?

Asked

Viewed 209 times

-1

Let’s go in pieces.

First, I already tested Enviorps and Envioloterps and both return the same error:

[1057] Rejeição - Assinatura difere do calculado.

I’m forming XML and it’s getting this way:

https://pastebin.com/NBXtXN0m

I am using the PHP SPED NFE library to sign XML

https://github.com/nfephp-org/nfephp

Using ONLY to sign XML, as follows:

    $certificate = Certificate::readPfx(file_get_contents($cert_path.'cert.pfx'), '1234');
    $xml_signed = Signer::sign($certificate, $xml_signed,
        'PedidoEnvioLoteRPS', // Tag à ser assinada
        null,
        OPENSSL_ALGO_SHA1    // Algorithm
    );

And using this signed XML for sending to Webservice.

I have already received error 1056 and 1057, both concerning the signature and Digest.

Someone has an example generation file of this Nfse, signing it using PFX (A1)?

Can anyone help me with this question?

Thank you.

1 answer

0

I just had the same problem. exchange this:

$xml_signed = Signer::sign($certificate, $xml_signed,
        'PedidoEnvioLoteRPS', // Tag à ser assinada
        null,
        OPENSSL_ALGO_SHA1    // Algorithm
    );

therefore:

  $canonical = [false,false,null,null];
    $xml_signed = Signer::sign($certificate, $xml_signed,
    'PedidoEnvioLoteRPS', 
    '', 
    OPENSSL_ALGO_SHA1,
    $canonical,
    '');  

Browser other questions tagged

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