2017 © Pedro Peláez
 

library xmlseclibs

A PHP library for XML Security (redBus fork)

image

redbus-peru/xmlseclibs

A PHP library for XML Security (redBus fork)

  • Friday, March 10, 2017
  • by ejosvp
  • Repository
  • 2 Watchers
  • 0 Stars
  • 51 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 92 Forks
  • 0 Open issues
  • 17 Versions
  • 0 % 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

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

Requirements

xmlseclibs requires PHP version 5.3 or greater., (*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'));
// Load the private key
$objKey->loadKey('./path/to/privatekey.pem', TRUE);
/* 
If key has a passphrase, set it using 
$objKey->passphrase = '<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

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

The Versions

10/03 2017

dev-master

9999999-dev https://github.com/redbus-peru/xmlseclibs

A PHP library for XML Security (redBus fork)

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.3

 

xml security signature xmldsig

10/03 2017

dev-redbus

dev-redbus https://github.com/redbus-peru/xmlseclibs

A PHP library for XML Security (redBus fork)

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.3

 

xml security signature xmldsig

10/03 2017

dev-addSignId

dev-addSignId https://github.com/redbus-peru/xmlseclibs

A PHP library for XML Security (redBus fork)

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.3

 

xml security signature xmldsig

09/03 2017

dev-add-getSignature-method

dev-add-getSignature-method 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

23/09 2016

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

23/09 2016

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

23/09 2016

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

 

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