Questions tagged [node-forge]

33 questions
16
votes
1 answer

What did a npm audit fix --force change and how do you fix it?

I was trying to npm install apn --save and used npm audit fix --force. The 'Hope you know what you are doing' message made me realize that I dont know what I am doing. After that I originally was getting node /home/ec2-user/myapp/bin/www: symbol…
BrianMiz
  • 1,101
  • 1
  • 10
  • 15
3
votes
1 answer

Creating a TLS connection from a button within a browser using node-forge?

Would it be possible to create a TLS connection from within a browser using node-forge? I'm basically looking to test/verify the TLS handshake and simply output info about it in the browser. Node-forge seems like a javascript tls implementation but…
TMStackO
  • 313
  • 3
  • 13
2
votes
0 answers

How to add CRLs to caStore created by Node-forge

I have create a caStore and want to add CRLs to it so that the caStore can reject the same when came across. I have looked everywhere but unable to find the same const pki = forge.pki; const asn1 = require('asn1js'); let caStore =…
2
votes
0 answers

node-forge Error: "Cannot read public key. OID is not RSA." when loading SSL certificate

I need to verify SSL certificates in node.js. Basically, I want to do the same as $ openssl verify -CApath ./roots_certs -untrusted ca_bundle.pem cert.pem. I currently use node-forge, but for some certificates (for many other certs it's working) I…
Pascal
  • 2,590
  • 3
  • 21
  • 46
1
vote
0 answers

nodejs hmac md5 incorrect calculation

Guys how is it possible that crypto produces the following hash console.log(crypto.createHmac('md5', 'key').update('value').digest('hex')) 01433efd5f16327ea4b31144572c67f6 whereas node-forge produces incorrect one, however works fine for SSL…
Ouveaus
  • 31
  • 3
1
vote
1 answer

When encrypting, decrypting, then re-encrypting a string with node-forge's AES impl, why are the encrypted and re-encrypted strings different?

I am trying to use node-forge to decrypt strings encrypted by another application. After decrypting I am not getting the original strings back, so I decided to put together the following SSCCE that encrypts a string, decrypts it, then re-encrypts…
David
  • 14,569
  • 34
  • 78
  • 107
1
vote
1 answer

Why is the signature verification not working when the signature is constructed by node-forge?

I have a Nuxt application that needs to retrieve some information from a Spring Boot-based auth service. Right now I sign a text message on the Nuxt app (the auth server is aware of that text message), using node-forge, and then I send it encrypted…
1
vote
1 answer

ng build error for package node-forge during deployment

We are getting below error in our docker deployment ng build fails due to URLSearchParams is not defined at Object. (/usr/src/app/node_modules/node-forge/lib/log.js:305:5)
Sumit Ganjave
  • 83
  • 1
  • 8
1
vote
1 answer

node-forge use certificationRequestFromPem to then get the SHA-256 Hash of CSR and MD5 Hash

I am using node-forge, and need to parse a CSR-PEM which can be done with the following method: Forge.pki.certificationRequestFromPem(csr) But now i need to get the SHA-256 Hash of the CSR and a MD5 Hash. I have gone through all the examples and…
PixelPaul
  • 1,022
  • 1
  • 10
  • 18
1
vote
0 answers

Encode and decode signature in certification generated by forge

I am using node-forge to generate and validate certificates I am generating and validating certificates and everything seems to work perfectly, but when it comes to the part where I do need to provide a signature to certificate it fails To clarify:…
Abdulrahman Falyoun
  • 3,676
  • 3
  • 16
  • 43
1
vote
1 answer

How to decrypt CMS /PKCS#7 with node forge

I try to decode a CMS /PKCS#7 with node forge. Private key and data are in files. Key is PEM, data is DER. That's my code: import forge from 'node-forge' import fs from 'fs'; let data = fs.readFileSync( __dirname + '/data'); let Key =…
0
votes
0 answers

What is 05 in hex

I'm using the Node-Forge library for AES encryption. I know AES needs to be padded to the ceiling of the block size. Node-Forge uses the hex code 05 for padding. What is this code, and how should I unpad the message? Right now I'm doing something…
0
votes
0 answers

Extract public key from a DER encoded X.509 Cert using node-forge and Javascript

I have an asymmetric key created in AWS KMS. I am trying to obtain it's public key using Javascript. To do that, I use the GetPublicKey API that comes with the aws-sdk. In the API's response, the public key is returned as an Uint8Array which…
SpikETidE
  • 6,711
  • 15
  • 46
  • 62
0
votes
0 answers

node-forge in Angular 11 RSA Generate Keys using prng causes http://localhost:4200/forge/prime.worker.js 404 (Not Found)

From the great answer here I took the example to try to use node-forge with prng in my Angular test project. In one of my prior tests with Angular and node-forge I have used the following function: pki.rsa.generateKeyPair({ bits: 4096, workers: -1…
GCJohn
  • 1
  • 1
0
votes
0 answers

forge jsdelivr is not working in my production environment

hello please pardon me this is my first time here, I have a node js application that I use in RSA encryption, and on the client side I'm using jsdelivr like in…
1
2 3