2017 © Pedro PelĂĄez
 

library xmlseclibs_sunat

A PHP library for XML Security

image

ninosimeon/xmlseclibs_sunat

A PHP library for XML Security

  • Wednesday, March 22, 2017
  • by ninosimeon
  • Repository
  • 1 Watchers
  • 0 Stars
  • 14 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 91 Forks
  • 0 Open issues
  • 18 Versions
  • 17 % Grown

The README.md

xmlseclibs_sunat

xmlseclibs_sunat es una librerĂ­a hecha en PHP para la firma electrĂłnica de documentos XML., (*1)

El autor de xmlseclibs es Rob Richards. Repositorio oficial: https://github.com/robrichards/xmlseclibs, (*2)

Requerimientos

xmlseclibs_sunat requiere PHP 5.3 o mayor., (*3)

How to Install

Install with composer.phar., (*4)

php composer.phar require "ninosimeon/xmlseclibs_sunat"

Use cases

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

Basic usage

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

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('ds', $signId);
// 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, (*7)

The Versions

22/03 2017

3.0.1

3.0.1.0 https://github.com/ninosimeon/xmlseclibs_sunat

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.3

 

xml security signature xmldsig

22/03 2017

dev-master

9999999-dev https://github.com/ninosimeon/xmlseclibs_sunat

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.3

 

xml security signature xmldsig

22/03 2017

dev-devel

dev-devel https://github.com/ninosimeon/xmlseclibs_sunat

A PHP library for XML Security

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.3

 

xml security signature xmldsig

22/03 2017

dev-stable

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

22/03 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.3

 

xml security signature xmldsig

09/03 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.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

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