PHPackages                             greenter/xmldsig - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. greenter/xmldsig

ActiveLibrary[Security](/categories/security)

greenter/xmldsig
================

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

v5.0.3(5y ago)38794.6k—0.7%14[2 issues](https://github.com/thegreenter/xmldsig/issues)8BSD-2-ClausePHPPHP &gt;=5.5.9

Since Jan 3Pushed 5y ago5 watchersCompare

[ Source](https://github.com/thegreenter/xmldsig)[ Packagist](https://packagist.org/packages/greenter/xmldsig)[ Docs](https://github.com/thegreenter/xmldsig)[ RSS](/packages/greenter-xmldsig/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)DependenciesVersions (11)Used By (8)

XmlDSig - Greenter
==================

[](#xmldsig---greenter)

[![Travis-CI](https://camo.githubusercontent.com/c090892bb011fcbfa796d071df3e12d48c72de4f62b490ec2c0f4acdde4098e4/68747470733a2f2f7472617669732d63692e6f72672f6769616e73616c65782f786d6c647369672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/giansalex/xmldsig)[![Codacy Badge](https://camo.githubusercontent.com/4529f17c9ac7e9c887b7ba159056c8c095df7cc1ae6ad0c9946ce9a3a02ed656/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6362353662666633636431353435663238343136313434343862663331646132)](https://www.codacy.com/app/giansalex/xmldsig?utm_source=github.com&utm_medium=referral&utm_content=giansalex/xmldsig&utm_campaign=Badge_Grade)

Esta libreria se emplea para firmar comprobantes electrónicos según las normas de SUNAT.

Se requiere el certificado en formato .PEM, puede utilizar el siguiente ejemplo para [convertir el certificado .PFX al otros formatos](https://github.com/thegreenter/xmldsig/blob/master/CONVERT.md).

Instalar:
---------

[](#instalar)

Empleando composer desde [packagist](https://packagist.org/packages/greenter/xmldsig).

```
composer require greenter/xmldsig
```

Ejemplo
-------

[](#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('....');

file_put_contents("signed.xml", $xmlSigned);
```

**Resultado:**

Antes:

```

```

Despues:

```

                    IwJuNQGQaHmmm3iv2jj8JDv70Ow=

                nLaghokzMNrmrfPnbIg9b........wzZ2CgLTVjWQUAQ4wDAYDVQQIEwVNYWluZTE1UiLFwZXXXPUlf2o=

                        MIIFhzCCA3OgAwI......MIIEVDCCAzygAwIBAgIJAPTrkMJbCOr1MA0GCSqGSIb3DQEBBQUAMHkxCzAJBgNVBAYTAlVTVQQIEwVNYWluZTEgMOiRJ00nE=

```

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity50

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~104 days

Recently: every ~222 days

Total

10

Last Release

2118d ago

Major Versions

1.0.2 → v4.0.12018-02-14

v4.1.0 → v5.0.02018-02-25

PHP version history (2 changes)1.0.0PHP &gt;= 5.6

1.0.1PHP &gt;=5.5.9

### Community

Maintainers

![](https://www.gravatar.com/avatar/fe086524f65d72195ad5dfd938bcd0b06349581b48ec60c56c5ba654167c8f55?d=identicon)[giansalex](/maintainers/giansalex)

---

Top Contributors

[![giansalex](https://avatars.githubusercontent.com/u/14926587?v=4)](https://github.com/giansalex "giansalex (66 commits)")

---

Tags

facturacion-electronicagreenterphpxml-signaturexmldsigxmlsecuritysignaturexmldsigsunat

### Embed Badge

![Health badge](/badges/greenter-xmldsig/health.svg)

```
[![Health](https://phpackages.com/badges/greenter-xmldsig/health.svg)](https://phpackages.com/packages/greenter-xmldsig)
```

###  Alternatives

[robrichards/xmlseclibs

A PHP library for XML Security

41478.1M118](/packages/robrichards-xmlseclibs)[ass/xmlsecurity

The XmlSecurity library is written in PHP for working with XML Encryption and Signatures

955.6M30](/packages/ass-xmlsecurity)[fr3d/xmldsig

Tool for easy management of XML Signatures (http://www.w3.org/TR/xmldsig-core/)

63150.6k1](/packages/fr3d-xmldsig)[lyquidity/xml-signer

A PHP to create and verify XAdES signature

2164.6k1](/packages/lyquidity-xml-signer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
