Why convert P7M to P7S?
A .p7m is an embedded-signature container where the document and signature are bundled together. A .p7s is a detached signature that lives in a separate file beside the original document. Both use the same PKCS#7/CMS standard (RFC 5652). Some systems or archives require detached signatures rather than embedded ones, making this workflow necessary in specific technical integrations.
How to convert P7M to P7S
OpenSSL OPEN-SOURCE
Extract the inner document with openssl smime -verify -in document.p7m -inform DER -noverify -out inner.pdf, then create the detached signature with openssl cms -sign -in inner.pdf -signer cert.pem -inkey key.pem -out signature.p7s -outform DER -detach.
About these formats
A .p7m file is a PKCS#7/CMS container that wraps an original document - usually a PDF or XML e-invoice - together with a digital signature and/or encryption. To open it, use DiKe…
Open .P7M details →A P7S file - usually named smime.p7s - is the digital signature attached to a signed email. It proves the sender's identity and that the message was not altered in transit. You normally do…
Open .P7S details →Quality & what to watch
- Re-signing breaks the original signature - the new
.p7sis signed by your certificate, not the original signer's. - If preserving the original signer's proof is a legal requirement, keep the
.p7mas the authoritative record and do not re-sign. - No GUI application in common use performs this specific conversion; it is a niche technical workflow handled only at the command line.
Frequently asked questions
Why is OpenSSL the only tool for this?
.p7m-to-.p7s workflow; it requires command-line access to cryptographic signing operations.Is the signature in a `.p7s` the same as in the original `.p7m`?
What is the difference between `.p7m` and `.p7s`?
.p7m embeds the document content inside the signature container, while .p7s is a separate sidecar file that references the document externally.