Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

signFromFile return null #1

Closed
jeanechabaudis opened this issue Mar 10, 2018 · 7 comments
Closed

signFromFile return null #1

jeanechabaudis opened this issue Mar 10, 2018 · 7 comments

Comments

@jeanechabaudis
Copy link

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
Copy link
Member

Fixed, thanks.

@jeanechabaudis
Copy link
Author

I'm still receiving null, xml attachment and code

signed.zip

@giansalex
Copy link
Member

  • You need to convert cert.pfx -> cert.pem, tutorial here
  • Use xmldsig v5.0.1 in composer.json

@jeanechabaudis
Copy link
Author

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

@jeanechabaudis
Copy link
Author

jeanechabaudis commented Mar 12, 2018

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
Copy link
Member

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

@jeanechabaudis
Copy link
Author

Okay thanks for your help :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants