2017 © Pedro Peláez
 

library xmldsig

Libreria para firmar XML según normativa de SUNAT en Facturación Electrónica

image

giansalex/xmldsig

Libreria para firmar XML según normativa de SUNAT en Facturación Electrónica

  • Monday, March 12, 2018
  • by giansalex
  • Repository
  • 1 Watchers
  • 1 Stars
  • 386 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 24 Versions
  • 0 % Grown

The README.md

XmlDSig - Greenter

Travis-CI Codacy Badge, (*1)

Esta libreria se emplea para firmar comprobantes electrónicos según las normas de SUNAT., (*2)

Se requiere el certificado en formato .PEM, puede utilizar el siguiente ejemplo para convertir el certificado .PFX al otros formatos., (*3)

Instalar:

Empleando composer desde packagist., (*4)

composer require greenter/xmldsig

Ejemplo


use Greenter\XMLSecLibs\Sunat\SignedXml; require 'vendor/autoload.php'; $xmlPath = '20600995805-01-F001-1.xml'; $certPath = 'certifcate.pem'; // Antes convertir pfx -> pem (private+certificate keys) $signer = new SignedXml(); $signer->setCertificateFromFile($certPath); // or $signer->setCertificate('-----BEGIN RSA PRIVATE KEY-----.....'); $xmlSigned = $signer->signFromFile($xmlPath); // or $signer->signXml('<Invoice>....'); file_put_contents("signed.xml", $xmlSigned);

Resultado:, (*5)

Antes:, (*6)

<ext:UBLExtensions>
    <ext:UBLExtension>
        <ext:ExtensionContent></ext:ExtensionContent>
    </ext:UBLExtension>
</ext:UBLExtensions>

Despues:, (*7)

<ext:UBLExtensions>
    <ext:UBLExtension>
        <ext:ExtensionContent>
            <ds:Signature Id="SignIMM">
                <ds:SignedInfo>
                    <ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
                    <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
                    <ds:Reference URI="">
                    <ds:Transforms>
                        <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
                    </ds:Transforms>
                    <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
                    <ds:DigestValue>IwJuNQGQaHmmm3iv2jj8JDv70Ow=</ds:DigestValue>
                    </ds:Reference>
                </ds:SignedInfo>
                <ds:SignatureValue>
                nLaghokzMNrmrfPnbIg9b........wzZ2CgLTVjWQUAQ4wDAYDVQQIEwVNYWluZTE1UiLFwZXXXPUlf2o=
                </ds:SignatureValue>
                <ds:KeyInfo>
                    <ds:X509Data>
                        <ds:X509Certificate>
                        MIIFhzCCA3OgAwI......MIIEVDCCAzygAwIBAgIJAPTrkMJbCOr1MA0GCSqGSIb3DQEBBQUAMHkxCzAJBgNVBAYTAlVTVQQIEwVNYWluZTEgMOiRJ00nE=
                        </ds:X509Certificate>
                    </ds:X509Data>
                </ds:KeyInfo>
            </ds:Signature>
        </ext:ExtensionContent>
    </ext:UBLExtension>
</ext:UBLExtensions>

The Versions

12/03 2018

dev-master

9999999-dev https://github.com/giansalex/xmldsig

Libreria para firmar XML según normativa de SUNAT en Facturación Electrónica

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.5.9

 

xml security signature xmldsig sunat

11/03 2018

v5.0.1

5.0.1.0 https://github.com/giansalex/xmldsig

Libreria para firmar XML según normativa de SUNAT en Facturación Electrónica

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.5.9

 

xml security signature xmldsig sunat

25/02 2018

v5.0.0

5.0.0.0 https://github.com/giansalex/xmldsig

Libreria para firmar XML según normativa de SUNAT en Facturación Electrónica

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.5.9

 

xml security signature xmldsig sunat

16/02 2018

v4.1.0

4.1.0.0 https://github.com/giansalex/xmldsig

Libreria para firmar XML según normativa de SUNAT en Facturación Electrónica

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.5.9

 

xml security signature xmldsig sunat

14/02 2018

v4.0.1

4.0.1.0 https://github.com/giansalex/xmldsig

Libreria para firmar XML según normativa de SUNAT en Facturación Electrónica

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.5.9

 

xml security signature xmldsig sunat

22/01 2018

1.0.2

1.0.2.0 https://github.com/giansalex/xmldsig

Libreria para firmar XML según normativa de SUNAT en Facturación Electrónica

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.5.9

 

xml security signature xmldsig sunat

03/01 2018

1.0.1

1.0.1.0 https://github.com/giansalex/xmldsig

Libreria para firmar XML según normativa de SUNAT en Facturación Electrónica

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.5.9

 

xml security signature xmldsig sunat

03/01 2018

1.0.0

1.0.0.0 https://github.com/giansalex/xmldsig

Libreria para firmar XML según normativa de SUNAT en Facturación Electrónica

  Sources   Download

BSD-2-Clause

The Requires

  • php >= 5.6

 

xml security signature xmldsig sunat

16/10 2017

3.0.3

3.0.3.0 https://github.com/robrichards/xmldsig

Herramienta para Firmar XML segun normativa de SUNAT para Facturación Electrónica

  Sources   Download

BSD-2-Clause

The Requires

  • php >= 5.6

 

xml security signature xmldsig sunat

02/08 2017

3.0.2

3.0.2.0 https://github.com/robrichards/xmldsig

Herramienta para Firmar XML segun normativa de SUNAT para Facturación Electrónica

  Sources   Download

BSD-2-Clause

The Requires

  • php >= 5.6

 

xml security signature xmldsig sunat

24/07 2017

3.0.1

3.0.1.0 https://github.com/robrichards/xmldsig

Herramienta para Firmar XML segun normativa de SUNAT para Facturación Electrónica

  Sources   Download

BSD-2-Clause

The Requires

  • php >= 5.6

 

xml security signature xmldsig sunat

25/05 2017

3.0.0

3.0.0.0 https://github.com/robrichards/xmlseclibs

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.6

 

xml security signature xmldsig

23/09 2016

1.4.x-dev

1.4.9999999.9999999-dev https://github.com/robrichards/xmlseclibs

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.2

 

xml security signature xmldsig

23/09 2016

2.0.x-dev

2.0.9999999.9999999-dev https://github.com/robrichards/xmlseclibs

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.3

 

xml security signature xmldsig

08/09 2016

1.4.2

1.4.2.0 https://github.com/robrichards/xmlseclibs

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.2

 

xml security signature xmldsig

08/09 2016

2.0.1

2.0.1.0 https://github.com/robrichards/xmlseclibs

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.3

 

xml security signature xmldsig

31/07 2015

2.0.0

2.0.0.0 https://github.com/robrichards/xmlseclibs

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.3

 

xml security signature xmldsig

31/07 2015

1.4.1

1.4.1.0 https://github.com/robrichards/xmlseclibs

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.2

 

xml security signature xmldsig

28/07 2015

dev-delete_decrypt

dev-delete_decrypt https://github.com/robrichards/xmlseclibs

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.2

 

xml security signature xmldsig

21/07 2015

1.3.x-dev

1.3.9999999.9999999-dev https://github.com/robrichards/xmlseclibs

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

xml security signature xmldsig

24/06 2015

1.3.4

1.3.4.0 https://github.com/robrichards/xmlseclibs

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

xml security signature xmldsig

23/06 2015

1.4.0

1.4.0.0 https://github.com/robrichards/xmlseclibs

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.2

 

xml security signature xmldsig

02/06 2015

1.3.3

1.3.3.0 https://github.com/robrichards/xmlseclibs

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

xml security signature xmldsig

21/05 2015

1.3.2

1.3.2.0 https://github.com/robrichards/xmlseclibs

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

xml security signature xmldsig