PHPackages                             greenterose/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. greenterose/xmldsig

ActiveLibrary[Security](/categories/security)

greenterose/xmldsig
===================

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

v5.0.2(6y ago)045BSD-2-ClausePHPPHP &gt;=5.5.9

Since Jan 3Pushed 6y agoCompare

[ Source](https://github.com/osktgui/xmldsig)[ Packagist](https://packagist.org/packages/greenterose/xmldsig)[ Docs](https://github.com/giansalex/xmldsig)[ RSS](/packages/greenterose-xmldsig/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (10)Used By (0)

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/giansalex/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'; // Convertir pfx to pem (public+private key)

$signer = new SignedXml();
$signer->setCertificateFromFile($certPath);

$xmlSigned = $signer->signFromFile($xmlPath);

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

**Resultado:**

Before:

```

```

After:

```

                    IwJuNQGQaHmmm3iv2jj8JDv70Ow=

                nLaghokzMNrmrfPnbIg9b........wzZ2CgLTVjWQUAQ4wDAYDVQQIEwVNYWluZTE1UiLFwZXXXPUlf2o=

                        MIIFhzCCA3OgAwI......MIIEVDCCAzygAwIBAgIJAPTrkMJbCOr1MA0GCSqGSIb3DQEBBQUAMHkxCzAJBgNVBAYTAlVTVQQIEwVNYWluZTEgMOiRJ00nE=

```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~73 days

Recently: every ~117 days

Total

8

Last Release

2538d 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/f38da0549ab79e66c5247777fe0bc43baad35e53fa01276a24f6f0d5cbedf01b?d=identicon)[osktgui](/maintainers/osktgui)

---

Top Contributors

[![robrichards](https://avatars.githubusercontent.com/u/210629?v=4)](https://github.com/robrichards "robrichards (77 commits)")[![giansalex](https://avatars.githubusercontent.com/u/14926587?v=4)](https://github.com/giansalex "giansalex (55 commits)")[![Maks3w](https://avatars.githubusercontent.com/u/1301698?v=4)](https://github.com/Maks3w "Maks3w (6 commits)")[![thijskh](https://avatars.githubusercontent.com/u/3808792?v=4)](https://github.com/thijskh "thijskh (6 commits)")[![RichWeber](https://avatars.githubusercontent.com/u/1702252?v=4)](https://github.com/RichWeber "RichWeber (4 commits)")[![tmilos](https://avatars.githubusercontent.com/u/1818373?v=4)](https://github.com/tmilos "tmilos (3 commits)")[![hiddewie](https://avatars.githubusercontent.com/u/1073881?v=4)](https://github.com/hiddewie "hiddewie (3 commits)")[![jaimeperez](https://avatars.githubusercontent.com/u/1942728?v=4)](https://github.com/jaimeperez "jaimeperez (3 commits)")[![klemenb](https://avatars.githubusercontent.com/u/2099210?v=4)](https://github.com/klemenb "klemenb (3 commits)")[![h3xx](https://avatars.githubusercontent.com/u/615684?v=4)](https://github.com/h3xx "h3xx (1 commits)")[![Slamdunk](https://avatars.githubusercontent.com/u/152236?v=4)](https://github.com/Slamdunk "Slamdunk (1 commits)")[![gfaust-qb](https://avatars.githubusercontent.com/u/13354975?v=4)](https://github.com/gfaust-qb "gfaust-qb (1 commits)")[![BernardoSilva](https://avatars.githubusercontent.com/u/1537510?v=4)](https://github.com/BernardoSilva "BernardoSilva (1 commits)")

---

Tags

xmlsecuritysignaturexmldsigsunat

### Embed Badge

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

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

###  Alternatives

[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[greenter/xmldsig

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

38794.6k9](/packages/greenter-xmldsig)[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)
