Closed jeanechabaudis closed 6 years ago
Fixed, thanks.
I'm still receiving null, xml attachment and code
cert.pfx
-> cert.pem
, tutorial herecomposer.json
if it is converted and keeps returning null, I attach the arvhivo .pem certificate.zip
Sorry it was my mistake, I just had to update the package with composer but the X509SubjectName tag does not have to be something similar
<X509SubjectName>E=rubenmedinag@hotmail.com, CN=AGUILAR APONTE DE ARAUCO CONSTANTINA VILMA, OU=DNI 20053183 RUC 20516109549, OU=DNI 20053183 RUC 20516109549, O=INVERSIONES DEL VALLE EIRL, L=LIMA, S=ATE, C=PE</X509SubjectName>
X509SubjectName is not required. That is an additional information.
ds:X509Data/ds:X509Certificate
contains that information.
Okay thanks for your help :D
I'm doing the example of the README.md and at the moment of executing the method signFromFile returns a null value and does not sign the xml
this my code:
use Greenter\XMLSecLibs\Sunat\SignedXml;
require 'vendor/autoload.php';
$xmlPath = '20516109549-01-F001-70.xml'; $certPath = 'certificate.pem'; // Convertir pfx to pem
$signer = new SignedXml(); $signer->setCertificateFromFile($certPath);
$xmlSigned = $signer->signFromFile($xmlPath);
var_dump($xmlSigned);