New question

Question:

Date: 09-06-2020 19:27:29 (In Spanish)

¿Cómo obtener el <DigestValue>?[Unresolved]

Como se obtiene el <DigestValue> ? . En el ejemplo siguiente esta la firma de un XML .

$txtcertificado = file_get_contents($url_ubicacion_certificado); //leer archivo pfx
// nota este valor es ilegible

openssl_pkcs12_read($txtcertificado, $certificado, $clave_certificado) //sacar información del pfx

$datos_certificado = openssl_x509_parse($certificado);//obtengo datos del certificado

$txt_a_firmar = '<SignedInfo xmlns="http://www.w3.org/2000/09/xmldsig#"><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#'.$dte_iden.'"><Transforms><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform>'.'</Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>'.$dte_dg.'</DigestValue></Reference></SignedInfo>';

openssl_sign(txt_a_firmar, $firma, $datos_certificado ["pkey"], OPENSSL_ALGO_SHA1);
Tags: Billing - PHP - PHP Advanced - PHP base64 - PHP Certification - Question - Script PHP - SimpleXML - SOAP - SoapClient - Webservices - XML Votes: 0 - Answers: 1 - Views: 10 Share on: Google Facebook Twitter LinkedIn Link
 

Answers:

To actively participate in the community first must authenticate, enter the system.Sign In
 
frjcbbae garagebible.com