Search code examples
client-certificates

How do I open a p7s file from the command line?


I am trying to open p7s files by command line, using openSSL with this line

openssl.exe smime -verify -in 1.pdf.P7s -noverify -inform DEM -out 1.pdf

openssl smime -inform DER -verify -noverify -in 1.pdf.p7s -out 1.pdf

But I am always getting this:

Verification failure 7100:error:04091068:rsa routines:int_rsa_verify:bad signature:crypto\rsa\rsa_sig n.c:220: 7100:error:21071069:PKCS7 routines:PKCS7_signatureVerify:signature failure:crypt o\pkcs7\pk7_doit.c:1041: 7100:error:21075069:PKCS7 routines:PKCS7_verify:signature failure:crypto\pkcs7\p k7_smime.c:353:

And generating a file I can't open.

Later edit: I found out that "A p7s is just a signature file in DER format. There is no "content" in that file, it's normally apart of a S/MIME message as a base64 attachment." but I still don't know how to get the base file.


Solution

  • Yeah, it seems that the version I've used (1.1.1) is giving me this error. Changing it an older version (1.0), it's working.