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

0

Let's break it down.

First, I have already tested the EnvioRPS and the EnvioLoteRPS and both return the same error:

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

I'm building XML and it's getting this way:

link

I'm using the PHP SPED NFE library to sign XML

link

Using ONLY to sign the 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 submission to the WebService.

I have already received error 1056 and 1057, both regarding signature and digest.

Does anyone have an example generation file for this NFSe, signing it using PFX (A1)?

Can anyone help me with this question?

Thank you.

    
asked by anonymous 06.07.2018 / 22:53

1 answer

0

I just had the same problem. change this:

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

so:

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