Skip to content
This repository was archived by the owner on Nov 3, 2021. It is now read-only.

Signing a digest #124

@wayne-davidson-tickle

Description

@wayne-davidson-tickle

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions