openssl cms -in demo.p7m -inform DER -verify verifies the signature on a CMS / PKCS7 encoded message but if the cert that did the signing is self-signed I get a "self signed certificate" error. ie. it doesn't seem to actually verify the CMS / PKCS7 signed message.

Any idea how I can verify a CMS / PKCS7 signed message that was signed by a self-signed cert?


#Try "-signer" Add the "-signer" parameter.

Like so:

openssl cms -in demo.p7m -inform DER -verify -signer MYSIGNERCERTIFICATEFILE

EDIT: aint' working.

  • It's not working meh. My P7M file: pastebin.com/8382eEsN(base64 decode it to get actual result) The signing cert: pastebin.com/D4rPmyM9 I still get the "self signed certificate" error. – neubert Aug 22 '15 at 2:19
  • Try -CAfile MYSIGNERCERTIFICATEFILE (instead of -verify MYSIGNERCERTIFICATEFILE). (And: This parameter is case-sensitive. It really must be capitalised as '-CAfile'. Other capitalisations like '-cafile' will NOT work.) -- But I think your demo.p7m is actually empty. – StackzOfZtuff Aug 22 '15 at 8:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.