To verify a files digital signature, OpenSSL dgst takes:
- public key (from sender)
- signature (from sender)
- the file (to verify it hasn't been modified from original sender's)
openssl dgst -sha256 -verify publicKey.pem -signature senderSig.der wholeFile.txt
It recalculates the SHA256 of the file and then compares that to the encrypted digital signature hash, to verify.
However, would like to do the SHA256 "myself" or outside of
dgst and pass that value to it instead of the file.
openssl dgst -verify publicKey.pem -signature senderSig.der -theFiles256Hash SHA256ofWholeFile.txt
Looking at the command parameters, seems possible but can't find the right combo.
Is this possible ?
dgst cannot do this, can it be broken down into steps using other OpenSSL utilities?