2017 © Pedro Peláez
 

library xmlseclibs

A PHP library for XML Security

image

simplesamlphp/xmlseclibs

A PHP library for XML Security

  • Wednesday, June 13, 2018
  • by jaime
  • Repository
  • 5 Watchers
  • 0 Stars
  • 179,019 Installations
  • PHP
  • 6 Dependents
  • 0 Suggesters
  • 91 Forks
  • 0 Open issues
  • 23 Versions
  • 2 % Grown

The README.md

xmlseclibs

xmlseclibs is a library written in PHP for working with XML Encryption and Signatures., (*1)

The author of xmlseclibs is Rob Richards., (*2)

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+, (*3)

Requirements

xmlseclibs requires PHP version 5.4 or greater. 5.6.24+ recommended for security reasons, (*4)

How to Install

Install with composer.phar., (*5)

php composer.phar require "robrichards/xmlseclibs"

Use cases

xmlseclibs is being used in many different software., (*6)

Basic usage

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

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'));
/*
If key has a passphrase, set it using
$objKey->passphrase = '<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

Mailing List: https://groups.google.com/forum/#!forum/xmlseclibs, (*8)

The Versions

13/06 2018

dev-xmlsec-ng

dev-xmlsec-ng https://github.com/simplesamlphp/xmlsec

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.4
  • ext-openssl *

 

The Development Requires

by Jaime Perez Crespo

xml security signature xmldsig

23/03 2018

dev-master

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

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.4
  • ext-openssl *

 

xml security signature signing x.509 certificate xmlsec xmldsig

23/02 2018

dev-bugfix/xpath

dev-bugfix/xpath https://github.com/robrichards/xmlseclibs

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.4
  • ext-openssl *

 

xml security signature xmldsig

21/02 2018

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

21/02 2018

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

14/02 2018

dev-bugfix/avoid-key-recursion

dev-bugfix/avoid-key-recursion https://github.com/robrichards/xmlseclibs

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.4
  • ext-openssl *

 

xml security signature xmldsig

31/08 2017

3.0.1

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

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.4

 

xml security signature xmldsig

17/08 2017

3.0.0-p1

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

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.4

 

xml security signature xmldsig

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

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

19/06 2013

dev-c14n-performance-fix

dev-c14n-performance-fix http://code.google.com/p/xmlseclibs/

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

xml security signature signing x.509 certificate xmlsec

19/06 2013

dev-develop

dev-develop http://code.google.com/p/xmlseclibs/

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

xml security signature signing x.509 certificate xmlsec

19/06 2013

1.3.1

1.3.1.0 http://code.google.com/p/xmlseclibs/

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

xml security signature signing x.509 certificate xmlsec

19/06 2013

v1.3.2

1.3.2.0 http://code.google.com/p/xmlseclibs/

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

xml security signature signing x.509 certificate xmlsec