Closed lviggiani closed 7 months ago
ok, the problem was the algorithm used while importing the key.
By using RSASSA-PKCS1-v1_5
it now works:
crypto.importKey("pkcs8", ber, {
name: "RSASSA-PKCS1-v1_5",
hash: "SHA-256"
},
true,
["sign"])
Consider the following code
In the first part I sign data and then I verify it against loaded certificate and it FAILS
In the second part I load a generated signature with openssl with same certificate and private key used in the first part and the verification against the loaded certificate is OK. So, since verification method is the same in both examples, I guess my signature method has something wrong. Here is the code for signature creation
Here is how I load certificate and key: