2017 © Pedro Peláez
 

library xmlseclibs

A PHP library for XML Security

image

robrichards/xmlseclibs

A PHP library for XML Security

  • Friday, March 23, 2018
  • by robrichards
  • Repository
  • 24 Watchers
  • 124 Stars
  • 1,911,820 Installations
  • PHP
  • 47 Dependents
  • 0 Suggesters
  • 91 Forks
  • 46 Open issues
  • 16 Versions
  • 17 % 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

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 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

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

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

01/05 2017

dev-remove_mcrypt

dev-remove_mcrypt 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