PHPackages                             redbus-peru/xmlseclibs - 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. redbus-peru/xmlseclibs

ActiveLibrary[Security](/categories/security)

redbus-peru/xmlseclibs
======================

A PHP library for XML Security (redBus fork)

2.0.1(9y ago)060BSD-3-ClausePHPPHP &gt;= 5.3

Since May 21Pushed 9y ago2 watchersCompare

[ Source](https://github.com/redbus-peru/xmlseclibs)[ Packagist](https://packagist.org/packages/redbus-peru/xmlseclibs)[ Docs](https://github.com/robrichards/xmlseclibs)[ RSS](/packages/redbus-peru-xmlseclibs/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (17)Used By (0)

\#xmlseclibs

xmlseclibs is a library written in PHP for working with XML Encryption and Signatures.

The author of xmlseclibs is Rob Richards.

Branches
========

[](#branches)

Both the master and the 1.4 branches are actively maintained. The 1.3 branch is only updated for security related issues.

- master: Contains namespace support requiring 5.3+.
- 1.4: Contains auto-loader support while also maintaining backwards compatiblity with the 1.3 version using the xmlseclibs.php file. Supports PHP 5.2+

Requirements
============

[](#requirements)

xmlseclibs requires PHP version 5.3 or greater.

How to Install
--------------

[](#how-to-install)

Install with [`composer.phar`](http://getcomposer.org).

```
php composer.phar require "robrichards/xmlseclibs"
```

Use cases
---------

[](#use-cases)

xmlseclibs is being used in many different software.

- [SimpleSAMLPHP](https://github.com/simplesamlphp/simplesamlphp)
- [LightSAML](https://github.com/lightsaml/lightsaml)

Basic usage
-----------

[](#basic-usage)

The example below shows basic usage of xmlseclibs, with a SHA-256 signature.

```
use RobRichards\XMLSecLibs\XMLSecurityDSig;
use RobRichards\XMLSecLibs\XMLSecurityKey;

// Load the XML to be signed
$doc = new DOMDocument();
$doc->load('./path/to/file/tobesigned.xml');

// Create a new Security object
$objDSig = new XMLSecurityDSig();
// Use the c14n exclusive canonicalization
$objDSig->setCanonicalMethod(XMLSecurityDSig::EXC_C14N);
// Sign using SHA-256
$objDSig->addReference(
    $doc,
    XMLSecurityDSig::SHA256,
    array('http://www.w3.org/2000/09/xmldsig#enveloped-signature')
);

// Create a new (private) Security key
$objKey = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, array('type'=>'private'));
// Load the private key
$objKey->loadKey('./path/to/privatekey.pem', TRUE);
/*
If key has a passphrase, set it using
$objKey->passphrase = '';
*/

// Sign the XML file
$objDSig->sign($objKey);

// Add the associated public key to the signature
$objDSig->add509Cert(file_get_contents('./path/to/file/mycert.pem'));

// Append the signature to the XML
$objDSig->appendSignature($doc->documentElement);
// Save the signed XML
$doc->save('./path/to/signed.xml');
```

How to Contribute
-----------------

[](#how-to-contribute)

- [Open Issues](https://github.com/robrichards/xmlseclibs/issues)
- [Open Pull Requests](https://github.com/robrichards/xmlseclibs/pulls)

Mailing List:

###  Health Score

30

—

LowBetter than 67% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 68.1% 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 ~49 days

Recently: every ~105 days

Total

11

Last Release

3467d ago

Major Versions

1.4.1 → 2.0.02015-07-31

1.4.2 → 2.0.x-dev2016-09-23

PHP version history (2 changes)1.4.0PHP &gt;= 5.2

2.0.0PHP &gt;= 5.3

### Community

Maintainers

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

---

Top Contributors

[![robrichards](https://avatars.githubusercontent.com/u/210629?v=4)](https://github.com/robrichards "robrichards (64 commits)")[![Maks3w](https://avatars.githubusercontent.com/u/1301698?v=4)](https://github.com/Maks3w "Maks3w (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)")[![jaimeperez](https://avatars.githubusercontent.com/u/1942728?v=4)](https://github.com/jaimeperez "jaimeperez (3 commits)")[![hiddewie](https://avatars.githubusercontent.com/u/1073881?v=4)](https://github.com/hiddewie "hiddewie (3 commits)")[![klemenb](https://avatars.githubusercontent.com/u/2099210?v=4)](https://github.com/klemenb "klemenb (3 commits)")[![ejosvp](https://avatars.githubusercontent.com/u/220277?v=4)](https://github.com/ejosvp "ejosvp (2 commits)")[![thijskh](https://avatars.githubusercontent.com/u/3808792?v=4)](https://github.com/thijskh "thijskh (2 commits)")[![juliosbonifacio](https://avatars.githubusercontent.com/u/3698619?v=4)](https://github.com/juliosbonifacio "juliosbonifacio (1 commits)")[![gfaust-qb](https://avatars.githubusercontent.com/u/13354975?v=4)](https://github.com/gfaust-qb "gfaust-qb (1 commits)")[![juliobonifaciorb](https://avatars.githubusercontent.com/u/116217786?v=4)](https://github.com/juliobonifaciorb "juliobonifaciorb (1 commits)")[![BernardoSilva](https://avatars.githubusercontent.com/u/1537510?v=4)](https://github.com/BernardoSilva "BernardoSilva (1 commits)")

---

Tags

xmlsecuritysignaturexmldsig

### Embed Badge

![Health badge](/badges/redbus-peru-xmlseclibs/health.svg)

```
[![Health](https://phpackages.com/badges/redbus-peru-xmlseclibs/health.svg)](https://phpackages.com/packages/redbus-peru-xmlseclibs)
```

###  Alternatives

[robrichards/xmlseclibs

A PHP library for XML Security

41176.1M106](/packages/robrichards-xmlseclibs)[greenter/xmldsig

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

38774.2k8](/packages/greenter-xmldsig)[ass/xmlsecurity

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

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

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

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

A PHP to create and verify XAdES signature

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

PHPackages © 2026

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