Would be possible to validate a file with p7s detached signature? I'm trying to do that using Openssl, but I got a default message about openssl and unknown option -verify
here is my command:
openssl pkcs7 -inform DER -verify -noverify -in file.docx.p7s -out file.docx
is this possible to do a file verification and p7s signature using openssl?
-- edit...
Just to let you know. I got an p7s file with an pdf file. I'd like to know how to validate that.
Finally, I understand a litte bit about p7s file. This is pretty common to securing e-mail messages, but, I can use p7s files, that contains an PKCS#7 detached signatures with an certificate, to ensure the veracity of a file.
So, I sepparate my explanation, in parts to get easy to explain what I'm doing here. Please, correct me if there's something wrong!
First, Initial Config:
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365
Second, Creating an p7s File
openssl smime -sign -in test.pdf -inkey key.pem -outform DER -binary -signer cert.pem -out test.pdf.p7s
Finally, Verifying p7s File
openssl pkcs7 -inform der -in test.pdf.p7s -out test.pdf.pkcs7
openssl pkcs7 -print_certs -in test.pdf.pkcs7 -out test.pdf.pkcs7.cert
openssl smime -verify -binary -inform PEM -in test.pdf.pkcs7 -content test.pdf -certfile test.pdf.pkcs7.cert -nointern -noverify > /dev/null
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With