thegreenter / xmldsig

Firma digital en Facturación Electrónica
BSD 3-Clause "New" or "Revised" License
37 stars 14 forks source link

signFromFile return null #1

Closed jeanechabaudis closed 6 years ago

jeanechabaudis commented 6 years ago

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);

giansalex commented 6 years ago

Fixed, thanks.

jeanechabaudis commented 6 years ago

I'm still receiving null, xml attachment and code

signed.zip

giansalex commented 6 years ago
jeanechabaudis commented 6 years ago

if it is converted and keeps returning null, I attach the arvhivo .pem certificate.zip

jeanechabaudis commented 6 years ago

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>

giansalex commented 6 years ago

X509SubjectName is not required. That is an additional information. ds:X509Data/ds:X509Certificate contains that information.

jeanechabaudis commented 6 years ago

Okay thanks for your help :D