Closed abelnexus closed 6 years ago
use Greenter\XMLSecLibs\Certificate\X509Certificate; use Greenter\XMLSecLibs\Certificate\X509ContentType;
require 'vendor/autoload.php';
$pfx = file_get_contents('certi.pfx'); $password = 'EQ4qpJKSWGmnbFdq';
$certificate = new X509Certificate($pfx, $password); $pem = $certificate->export(X509ContentType::PEM);
file_put_contents('certificate.pem', $pem);
tienes los archivos.p12 y .cer
?
si
mmmm no se que paso pero ahora si me genero el archivo .pem
que bueno.
Hola, tengo el mismo problema que abelnexus, no se como utilizar estos 2 certificados, donde deben estar? como invocarlo?: use Greenter\XMLSecLibs\Certificate\X509Certificate; use Greenter\XMLSecLibs\Certificate\X509ContentType; alguien podria ayudarme.
amigo no encuentro la falla me aparece este error: Fatal error: Uncaught Exception: error:0D07803A:asn1 encoding routines:asn1_item_embed_d2i:nested asn1 error in C:\xampp\htdocs\xmldsig-master\src\Certificate\X509Certificate.php:184 Stack trace: #0 C:\xampp\htdocs\xmldsig-master\src\Certificate\X509Certificate.php(42): Greenter\XMLSecLibs\Certificate\X509Certificate->parsePfx('-----BEGIN CERT...', 'EQ4qpJKSWGmnbFd...') #1 C:\xampp\htdocs\xmldsig-master\index.php(10): Greenter\XMLSecLibs\Certificate\X509Certificate->__construct('-----BEGIN CERT...', 'EQ4qpJKSWGmnbFd...') #2 {main} thrown in C:\xampp\htdocs\xmldsig-master\src\Certificate\X509Certificate.php on line 184