Ver Mensaje Individual
  #2759  
Antiguo 10-02-2022
ion ion is offline
Registrado
 
Registrado: sep 2021
Posts: 8
Reputación: 0
ion Va por buen camino
LROE error cancelar ticketbai

Cita:
Empezado por Sistel Ver Mensaje
Hola ion,

Verifica el xml firmado en

Si te da correcto y te sigue contestando Batuz con ese error, comprueba con qué codificación se te guarda el fichero.

Saludos
Gracias, he verificado, y el xml no es correco:

Signature is Invalid
Number of Reference Digests = 3
Reference 1 digest is invalid because the computed digest differs from the digest in the XML.
Reference 2 digest is invalid because the computed digest differs from the digest in the XML.
Reference 3 digest is valid.

Uso la clase firmador de Bilbur, dejo el xml por si alguien podria ver el fallo:

Código PHP:
<?xml version='1.0' encoding='UTF-8'?>
<T:AnulaTicketBai xmlns:T='urn:ticketbai:anulacion'
    xmlns:xsi='....w3.org/2001/XMLSchema-instance' xsi:schemaLocation='....w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd'>
    <Cabecera>
        <IDVersionTBAI>1.2</IDVersionTBAI>
    </Cabecera>
    <IDFactura>
        ...
    </IDFactura>
    <HuellaTBAI>
        ...
        <NumSerieDispositivo>1212</NumSerieDispositivo>
    </HuellaTBAI>
    <ds:Signature Id="xmldsig-ca66fa5e-0dad-1d62-e99d-a992496461d1"
        xmlns:ds="....w3.org/2000/09/xmldsig#">
        <ds:SignedInfo>
            <ds:CanonicalizationMethod Algorithm="....w3.org/TR/2001/REC-xml-c14n-20010315"/>
            <ds:SignatureMethod Algorithm="....w3.org/2001/04/xmldsig-more#rsa-sha256"/>
            <ds:Reference URI="#xmldsig-ca66fa5e-0dad-1d62-e99d-a992496461d1-signedprops" Type="...uri.etsi.org/01903#SignedProperties">
                <ds:Transforms>
                    <ds:Transform Algorithm="....w3.org/TR/2001/REC-xml-c14n-20010315"/>
                </ds:Transforms>
                <ds:DigestMethod Algorithm="....w3.org/2001/04/xmlenc#sha256"/>
                <ds:DigestValue>GGw5r1urLgEdDqZzR9wYfvTAKqTi5vzGHjBCqPsX5u0=</ds:DigestValue>
            </ds:Reference>
            <ds:Reference Id="ReferenceKeyInfo" URI="#KeyInfoId-xmldsig-ca66fa5e-0dad-1d62-e99d-a992496461d1">
                <ds:Transforms>
                    <ds:Transform Algorithm="....w3.org/TR/2001/REC-xml-c14n-20010315"/>
                </ds:Transforms>
                <ds:DigestMethod Algorithm="....w3.org/2001/04/xmlenc#sha256" />
                <ds:DigestValue>249d1ODRQL8r2pEjkP9dxvUn5/5cKmBpmp4l8kPg460=</ds:DigestValue>
            </ds:Reference>
            <ds:Reference Id="xmldsig-ca66fa5e-0dad-1d62-e99d-a992496461d1-ref0" URI="" Type="....w3.org/2000/09/xmldsig#Object">
                <ds:Transforms>
                    <ds:Transform Algorithm="....w3.org/2000/09/xmldsig#enveloped-signature"/>
                    <ds:Transform Algorithm="....w3.org/TR/2001/REC-xml-c14n-20010315"/>
                </ds:Transforms>
                <ds:DigestMethod Algorithm="....w3.org/2001/04/xmlenc#sha256"/>
                <ds:DigestValue>leHXcKXIXb2WUnsMXH8/BLNlmg3gHjDHu+L57ESRma8=</ds:DigestValue>
            </ds:Reference>
        </ds:SignedInfo>
        ...
</T:AnulaTicketBai>

Última edición por Neftali [Germán.Estévez] fecha: 11-02-2022 a las 09:58:12. Razón: Añadir TAG's al código
Responder Con Cita