Why convert P7M to XML?
Italian electronic invoices sent via SDI (Sistema di Interscambio) arrive as XML files signed and wrapped in .p7m format. To import the invoice into accounting software or process it programmatically, you must unwrap the .p7m to access the raw .xml. The XML was always inside the container - extraction is not a format conversion.
How to convert P7M to XML
OpenSSL OPEN-SOURCE
Run openssl smime -verify -in invoice.xml.p7m -inform DER -noverify -out invoice.xml to extract the inner .xml; substitute openssl cms with the same flags if that command fails.
Dike (InfoCert) FREE
Open Dike, drag the .p7m file onto the window, and click Save Document or Extract after verification to save the inner .xml file.
Aruba Sign FREE
Open Aruba Sign, click Verify, select the .p7m, then use Save or View Document to export the inner .xml.
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 →An XML file is a plain-text document that stores structured data in nested, custom tags. Because it is just text, any text editor opens it - drag it into a browser tab for a quick,…
Open .XML details →Quality & what to watch
- The extracted XML is identical to the original - no data is altered or lost during extraction.
- Once extracted, the XML is unsigned; keep the original
.p7mif you need legal proof that the document was signed. - If extraction fails, try replacing
-inform DERwith-inform PEMin the OpenSSL command - some.p7mfiles are Base64-encoded rather than binary DER.
Frequently asked questions
Why do Italian e-invoices arrive as `.p7m` instead of plain `.xml`?
.p7m container.Can I extract the XML without validating the signature?
-noverify flag in the OpenSSL command skips trust-chain checking so you get the file out even without CA certificates installed.