Portions taken from http://www.cs.utexas.edu/~mitra/csSpring2011/cs327/cx_mac.html (in case that link ever dies.)
Assume you've got homebrew installed.
Download the following files from Oracle
| texto = 'ProBando' | |
| lowercase = 0 | |
| uppercase = 0 | |
| for c in texto: | |
| if c.islower(): | |
| lowercase += 1 | |
| if c.isupper(): | |
| uppercase += 1 | |
| const fs = require("fs"); | |
| const WebCrypto = require("node-webcrypto-ossl"); | |
| const xadesjs = require("xadesjs"); | |
| const { XMLSerializer } = require("xmldom-alpha"); | |
| const crypto = new WebCrypto(); | |
| xadesjs.Application.setEngine("OpenSSL", crypto); | |
| function preparePem(pem) { | |
| return pem |
| const WebCrypto = require("node-webcrypto-ossl"); | |
| const crypto = new WebCrypto(); | |
| const fs = require('fs'); | |
| const asn1js = require('asn1js'); | |
| const pkijs = require('pkijs'); | |
| const pvutils = require('pvutils'); | |
| function parsePKCS12Internal(buffer, password) | |
| { | |
| //region Initial variables |
| { | |
| "clave": "50609011800011717071900000000000000000034987656238", | |
| "fecha": "2018-01-24T03:43:46.930Z", | |
| "emisor": { | |
| "tipoIdentificacion": "01", | |
| "numeroIdentificacion": "117170719" | |
| }, | |
| "receptor": { | |
| "tipoIdentificacion": "02", | |
| "numeroIdentificacion": "3101660919" |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <FacturaElectronica xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://tribunet.hacienda.go.cr/docs/esquemas/2017/v4.2/facturaElectronica"> | |
| <Clave>50609011800011717071900000000000000000034987656238</Clave> | |
| <NumeroConsecutivo>00000000000000000032</NumeroConsecutivo> | |
| <FechaEmision>2018-01-08T20:25:49.049Z</FechaEmision> | |
| <Emisor> | |
| <Nombre>Alvaro Andres Zuniga Hernandez</Nombre> | |
| <Identificacion> | |
| <Tipo>01</Tipo> | |
| <Numero>117170719</Numero> |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <FacturaElectronica xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://tribunet.hacienda.go.cr/docs/esquemas/2017/v4.2/facturaElectronica"> | |
| <Clave>50609011800011717071900000000000000000034987656238</Clave> | |
| <NumeroConsecutivo>00000000000000000032</NumeroConsecutivo> | |
| <FechaEmision>2018-01-08T20:25:49.049Z</FechaEmision> | |
| <Emisor> | |
| <Nombre>Alvaro Andres Zuniga Hernandez</Nombre> | |
| <Identificacion> | |
| <Tipo>01</Tipo> | |
| <Numero>117170719</Numero> |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <MensajeHacienda xmlns="https://tribunet.hacienda.go.cr/docs/esquemas/2016/v4.1/mensajeHacienda"> | |
| <Clave>50609011800011717071900000000000000000034987656238</Clave> | |
| <NombreEmisor/> | |
| <TipoIdentificacionEmisor>01</TipoIdentificacionEmisor> | |
| <NumeroCedulaEmisor>117170719</NumeroCedulaEmisor> | |
| <NombreReceptor/> | |
| <TipoIdentificacionReceptor>02</TipoIdentificacionReceptor> | |
| <NumeroCedulaReceptor>3101660919</NumeroCedulaReceptor> | |
| <Mensaje>3</Mensaje> |
| #Esto va en el load | |
| if (VerifyLicense() == false) | |
| { | |
| MessageBox.Show("Licencia vencida contacte a ITCO para continuar"); | |
| Environment.Exit(1); | |
| } | |
| //la funcion | |
| private bool VerifyLicense() { |
Portions taken from http://www.cs.utexas.edu/~mitra/csSpring2011/cs327/cx_mac.html (in case that link ever dies.)
Assume you've got homebrew installed.
Download the following files from Oracle
| { | |
| "xml": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48RmFjdHVyYUVsZWN0cm9uaWNhIHhtbG5zPSJodHRwczovL3RyaWJ1bmV0LmhhY2llbmRhLmdvLmNyL2RvY3MvZXNxdWVtYXMvMjAxNy92NC4yL2ZhY3R1cmFFbGVjdHJvbmljYSIgeG1sbnM6eHNkPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSIgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSIgeHNpOnNjaGVtYUxvY2F0aW9uPSJodHRwczovL3RyaWJ1bmV0LmhhY2llbmRhLmdvLmNyL2RvY3MvZXNxdWVtYXMvMjAxNy92NC4yL2ZhY3R1cmFFbGVjdHJvbmljYSBodHRwczovL3RyaWJ1bmV0LmhhY2llbmRhLmdvLmNyL2RvY3MvZXNxdWVtYXMvMjAxNy92NC4yL2ZhY3R1cmFFbGVjdHJvbmljYS54c2QiPjxDbGF2ZT41MDYyNjA3MTgwMDAxMTcxNzA3MTkwMDEwMDAwMTAxMDAwMDAwMDAwMjE2ODIzOTM3NjwvQ2xhdmU+PE51bWVyb0NvbnNlY3V0aXZvPjAwMTAwMDAxMDEwMDAwMDAwMDAyPC9OdW1lcm9Db25zZWN1dGl2bz48RmVjaGFFbWlzaW9uPjIwMTgtMDctMjZUMDY6NTk6MjQuMjkzPC9GZWNoYUVtaXNpb24+PEVtaXNvcj48Tm9tYnJlPkFMVkFSTyBBTkRSRVMgWlXDkUlHQSBIRVJOQU5ERVo8L05vbWJyZT48SWRlbnRpZmljYWNpb24+PFRpcG8+MDE8L1RpcG8+PE51bWVybz4xMTcxNzA3MTk8L051bWVybz48L0lkZW50aWZpY2FjaW9uPjxVYmljYWNpb24+PFByb3ZpbmNpYT4xPC9Qcm92aW5jaWE+PENhb |