PHP code example of stibenamm / firma-xades-cr
1. Go to this page and download the library: Download stibenamm/firma-xades-cr 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/ */
stibenamm / firma-xades-cr example snippets
//routes/web.php
Route::get('/', function(){
$firmador = new Stibenamm\FirmaXadesCR\Firmador();
$xml = '/ruta/archivoXml';
$pfx = '/ruta/llaveCriptografica';
$pin = '0000';
$archivo = $firmador->firmarXml($pfx,$pin,$xml,$firmador::TO_XML_STRING);
return response($archivo, '200')->header('Content-Type', 'text/xml');
});