thegreenter / xmldsig

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

Warning: openssl_sign(): supplied key param cannot be coerced into a private key #2

Closed vinoles closed 6 years ago

vinoles commented 6 years ago

Hola amigo estoy tratando de usar tu librería cifrando con un archivo de extension .p12

$fileXmlName = "/path/file/factura.xml"; $docXmlExport = $rootNode->asXML($fileXmlName); $docXml = $rootNode->asXML();

    $certPath ="/path/file/key_example.p12"; 

    $signer = new SignedXml();
    $signer->setCertificateFromFile($certPath);

    $xmlSigned = $signer->signFromFile($fileXmlName);
    echo $xmlSigned;

al final me sale esta notificacion : Warning: openssl_sign(): supplied key param cannot be coerced into a private key

Pdrias ayudarme o indicarme que estoy haciendo mal??

saludos

giansalex commented 6 years ago

En la guia indica que se requiere un archivo .pem , que contenta tanto la clave publica y privada

vinoles commented 6 years ago

Ok amigo muchas gracias ...