Changes between Version 17 and Version 18 of actividades_2018_pruebas
- Timestamp:
- May 31, 2018, 9:20:19 AM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
actividades_2018_pruebas
v17 v18 598 598 Para este caso, como obtuvimos el certificado del firmarte y la clave privada con la librería forge en la función ''getCertificate'', necesitamos importar la clave privada para que pueda ser utilizada por la librería ''Crypto'' 599 599 600 {{{function importCryptoKeyPkcs8(privateKey,extractable) 600 {{{ 601 function importCryptoKeyPkcs8(privateKey,extractable) 601 602 { 602 603 var privateKeyInfoDerBuff = privateKeyToPkcs8(privateKey); … … 614 615 La función ''privateKeyToPkcs8'' transforma la clave priva en formato ''pkcs8'' 615 616 616 {{{function privateKeyToPkcs8(privateKey) 617 {{{ 618 function privateKeyToPkcs8(privateKey) 617 619 { 618 620 var rsaPrivateKey = forge.pki.privateKeyToAsn1(privateKey); … … 628 630 se usara esta función para enviarlo al servidor Murachí y completar la firma electrónica. 629 631 630 {{{function SingHash() 632 {{{ 633 function SingHash() 631 634 { 632 635 console.log("*.... SingFile ....*"); … … 660 663 Código de la función javaScript "SignFilePDF()" sección 3: 661 664 662 {{{document.getElementById("seccion2").innerHTML = responseString; 665 {{{ 666 document.getElementById("seccion2").innerHTML = responseString; 663 667 var json_x = data; 664 668 var hash = json_x['hash'];