-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Alternate WebCrypto Library? #178
Comments
PKIjs would work with any object looks same with standard WebCrypto API object. It is the first time I heard about the package and can’t say anything about it. |
We create : https://github.com/PeculiarVentures/webcrypto-liner and https://github.com/PeculiarVentures/node-webcrypto-ossl And they work well with PKIjs we don’t have experience with the referenced library. |
For future reference, replacing this code: const WebCrypto = require("node-webcrypto-ossl");
const webcrypto = new WebCrypto();
pkijs.setEngine("newEngine", webcrypto, new CryptoEngine({
name: "",
crypto: webcrypto,
subtle: webcrypto.subtle
})); With this code const crypto = require("@trust/webcrypto");
pkijs.setEngine("newEngine", crypto, new CryptoEngine({
name: "",
crypto: crypto,
subtle: crypto.subtle
})); Seems to work. I can verify a certificate, but I haven't tried anything more than that. Pros:
Cons:
|
@apowers313 In fact I myself had been working on something similar with |
@apowers313 Haha - just checked code: they are using this for ECDSA key generation: let privateKey = spawnSync('openssl', ['ecparam','-name',osslCurveName.name,'-genkey','-noout']).stdout
let publicKey = spawnSync('openssl', ['ec', '-pubout'], { input: privateKey }).stdout As I said working directly with Node's |
Yea, I got to the point where verify fails with Should anyone ever stumble across this thread and want to pick up where I left off here's the data I'm seeing:
(result is true with |
@apowers313 Tested it with CTjs - it provides incorrect results during ECDSA signature validation. So, please do not consider |
Yep, it's failing my tests too. |
It can be solved using this library: |
In theory, should it be possible to use @trust/webcrypto with pkijs? If so, do you know if anyone has ever tried it and / or successfully gotten it to work?
The text was updated successfully, but these errors were encountered: