PHP code example of paycore / xmldsig
1. Go to this page and download the library: Download paycore/xmldsig library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
paycore / xmldsig example snippets
use Greenter\XMLSecLibs\Sunat\SignedXml;
600995805-01-F001-1.xml');
$certPath = 'path-dir/SFSCert.pem'; // Convertir pfx to pem
$signer = new SignedXml();
$signer->setCertificateFromFile($certPath); // You can also use $signer->setCertificate ($certData);
$xmlSigned = $signer->signXml($xmlData);
header('Content-Type: text/xml');
echo $xmlSigned;