PHPackages                             vertex-it/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. vertex-it/xmlseclibs

ActiveLibrary[Security](/categories/security)

vertex-it/xmlseclibs
====================

A PHP library for XML Security

4.0.0(5y ago)049BSD-3-ClausePHPPHP &gt;= 5.4

Since May 21Pushed 5y agoCompare

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

READMEChangelogDependenciesVersions (28)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)

Master is currently the only actively maintained branch.

- master/3.1: Added AES-GCM support requiring 7.1+
- 3.0: Removes mcrypt usage requiring 5.4+ (5.6.24+ recommended for security reasons)
- 2.0: Contains namespace support requiring 5.3+
- 1.4: Contains auto-loader support while also maintaining backwards compatiblity with the older 1.3 version using the xmlseclibs.php file. Supports PHP 5.2+

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

[](#requirements)

xmlseclibs requires PHP version 5.4 or greater. **5.6.24+ recommended for security reasons**

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

[](#how-to-install)

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

```
php composer.phar require "vertex-it/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)
- [OneLogin](https://github.com/onelogin/php-saml)

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

[](#basic-usage)

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

```
use VertexIT\XMLSecLibs\XMLSecurityDSig;
use VertexIT\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'));
/*
If key has a passphrase, set it using
$objKey->passphrase = '';
*/
// Load the private key
$objKey->loadKey('./path/to/privatekey.pem', TRUE);

// 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/vertex-it/xmlseclibs/issues)
- [Open Pull Requests](https://github.com/vertex-it/xmlseclibs/pulls)

Mailing List:

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 67.3% 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 ~91 days

Recently: every ~117 days

Total

24

Last Release

1899d ago

Major Versions

1.4.2 → 3.0.02017-05-25

2.0.x-dev → 3.0.22018-09-27

2.1.0 → 3.0.42019-11-05

1.4.x-dev → 3.0.x-dev2020-04-22

3.1.1 → 4.0.02021-02-24

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

2.0.0PHP &gt;= 5.3

3.0.0PHP &gt;= 5.6

3.0.1PHP &gt;= 5.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/96c1a25c968511365a6cb7eabe93c52048d59e817b951d36fa18488d826964a6?d=identicon)[milivojsa](/maintainers/milivojsa)

---

Top Contributors

[![robrichards](https://avatars.githubusercontent.com/u/210629?v=4)](https://github.com/robrichards "robrichards (109 commits)")[![jaimeperez](https://avatars.githubusercontent.com/u/1942728?v=4)](https://github.com/jaimeperez "jaimeperez (11 commits)")[![thijskh](https://avatars.githubusercontent.com/u/3808792?v=4)](https://github.com/thijskh "thijskh (7 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)")[![hiddewie](https://avatars.githubusercontent.com/u/1073881?v=4)](https://github.com/hiddewie "hiddewie (3 commits)")[![gfaust-qb](https://avatars.githubusercontent.com/u/13354975?v=4)](https://github.com/gfaust-qb "gfaust-qb (3 commits)")[![tmilos](https://avatars.githubusercontent.com/u/1818373?v=4)](https://github.com/tmilos "tmilos (3 commits)")[![klemenb](https://avatars.githubusercontent.com/u/2099210?v=4)](https://github.com/klemenb "klemenb (3 commits)")[![tvdijen](https://avatars.githubusercontent.com/u/841045?v=4)](https://github.com/tvdijen "tvdijen (2 commits)")[![milivojsa](https://avatars.githubusercontent.com/u/17594274?v=4)](https://github.com/milivojsa "milivojsa (2 commits)")[![restena-sw](https://avatars.githubusercontent.com/u/6346943?v=4)](https://github.com/restena-sw "restena-sw (2 commits)")[![njake](https://avatars.githubusercontent.com/u/16844901?v=4)](https://github.com/njake "njake (1 commits)")[![iggyvolz](https://avatars.githubusercontent.com/u/2197376?v=4)](https://github.com/iggyvolz "iggyvolz (1 commits)")[![sbacelic](https://avatars.githubusercontent.com/u/647434?v=4)](https://github.com/sbacelic "sbacelic (1 commits)")[![Slamdunk](https://avatars.githubusercontent.com/u/152236?v=4)](https://github.com/Slamdunk "Slamdunk (1 commits)")[![h3xx](https://avatars.githubusercontent.com/u/615684?v=4)](https://github.com/h3xx "h3xx (1 commits)")[![dvaeversted](https://avatars.githubusercontent.com/u/1611810?v=4)](https://github.com/dvaeversted "dvaeversted (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/vertex-it-xmlseclibs/health.svg)

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

###  Alternatives

[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M117](/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)
