-
Notifications
You must be signed in to change notification settings - Fork 35
Signing a digest #124
Description
Hello,
I am using node-webcrypto-ossl via fortify.
I wish to sign a digest (I.E. as generated by subtle.digest OR as generated by another system). I believe the subtle.sign method does not expect a digest, it expects the message (original data) to be signed.
This is based on the assumption that subtle.sign (when using PKCS1) uses the RSA_PKCS1_sign method under the hood (https://github.com/PeculiarVentures/node-webcrypto-ossl/blob/master/src/rsa/rsa_pkcs1.cpp), which uses the EVP_DigestSign* methods, and that these methods are generating the digest internally.
I believe if i pass in a digest to the subtle.sign method, i will end up signing a digest of that digest.
Are there any plans to allow a digest to be passed in and have this digest signed (I.E. use the underlying EVP_Sign* methods instead of the EVP_DigestSign* methods).
https://wiki.openssl.org/index.php/EVP_Signing_and_Verifying
The use case for this is as follows:
- A PDF document requires digital signing
- The PDF is loaded in the browser via a URL
- We do not have access to the raw PDF data in the browser (E.G. as a base64 string)
(The PDFs may be large documents therefore it is better if these are loaded via a URL, not via passed in raw data) - We do however have a hash (digest) of the PDF available, this is what we would like to sign