Closed microshine closed 1 year ago
This PR resolves an issue where there was a problem with the ID value when importing certificates generated by another application. The current implementation generates a new ID for the public key, which causes issues when there are existing public keys with the same certificate. This update changes the implementation to reuse the existing ID from the public keys if it's possible; otherwise, it uses an ID generator, which is the current behavior.
This PR also updates the dependencies to their latest versions.
Thank you for accommodating the changes to import certificate, but when I try to compile the node-webcrypto-p11 project it is failing with the latest version of Node and NPM. I also tried wit Node version 14.x and it is still failing with that version although the previous old version was compiling successfully.
It would be great if you share some steps to build the node-webcrypto-p11 along with node and npm versions.
Thanks in advance.
I'm trying to publish this PR in NPM. But there is a problem with 2FA token. I'll let you know when it's done
NPM package v2.6.2 has been published 🎉
@sanawershoukat Please try the latest version
@microshine Thank you for your quick reply. Let me try to compile the library but as I mentioned above I was getting error while building the library so it would be great if you share the steps to compile the library with specific version of Node and NPM.
Thanks in advance.
@microshine below are the screenshots when I try to compile the library, I also tried compilation by upgrading the node and npm version but still fail to compile the library.
Thank you. I'll fix it
This is very interesting. I thought I use node:process
in my code, but I don't. It must build the package using npm run build
command. You can see it in actions that it works fine with Node v16 (see action log). And it works for me locally too.
so you just need
git clone git@github.com:PeculiarVentures/node-webcrypto-p11.git
cd ./node-webcrypto-p11
yarn
npm run build
@microshine
Hi,
Thank you for sharing the steps to compile the library, I successfully compiled it.
I am using this library in Fortify app to communicate with Smart Cards for multiple operations. Old version of Fortify had node-webcrypto-p11 2.3.6 version then I update the Fortify with the latest version of node-webcrypto-p11 and fix the issue while compiling the Fortify app.
When I tried to import the certificate it is logging server event error with below details:
info: [server-api] certStorage/importCert {"crypto":"AKIS","format":"raw","algorithm":{"name":"RSASSA-PKCS1-v1_5","hash":"SHA-256"},"keyUsages":["verify"]} error: [server] Server event error {"error":{"name":"Pkcs11Error","message":"CKR_VENDOR_DEFINED","method":"C_CreateObject","nativeStack":" at Error (native) PKCS11::C_CreateObject:567","code":2147483651}}
Let me know if I am missing something and you can share other library by using which I can directly import the certificate into Smart Card.
Thanks in advance.
This PR resolves an issue where there was a problem with the ID value when importing certificates generated by another application. The current implementation generates a new ID for the public key, which causes issues when there are existing public keys with the same certificate. This update changes the implementation to reuse the existing ID from the public keys if it's possible; otherwise, it uses an ID generator, which is the current behavior.
This PR also updates the dependencies to their latest versions.