How to use the P7M viewer tool
- Choose the signed invoice under Invoice file. The picker accepts .p7m and .pem files up to 30 MiB.
- Select Extract invoice and wait for the status line to say Done.
- Read the invoice number, date, seller, buyer, total and number of lines in the Result box.
- Select Download to save the enclosed FatturaPA document as invoice.xml, or Copy to copy the summary.
What a P7M file is
A .p7m file is a signed envelope in the Cryptographic Message Syntax (CMS), defined in RFC 5652 and descended from PKCS #7, which gives the extension its name. The envelope is an ASN.1 structure of type SignedData. It holds the original document, one or more signatures and usually the signers' certificates.
In Italy, invoices sent through the Sistema di Interscambio (SdI) may be signed with CAdES, which produces a file such as IT01234567890_FPR01.xml.p7m. Because the XML sits inside a binary wrapper, a text editor or browser cannot display it directly.
How the P7M viewer extracts the invoice
The tool parses the file as BER or DER encoded ASN.1 and checks that the content type is SignedData, object identifier 1.2.840.113549.1.7.2. It then reads the encapsulated content, an octet string holding the original file, and decodes it as XML. If the file starts with a PEM header line, the Base64 body is decoded first.
The extracted document must be a FatturaPA invoice with the root element FatturaElettronica. The fields come from the first DatiGeneraliDocumento block: Numero, Data, Divisa and ImportoTotaleDocumento, with party names taken from Denominazione or from Nome and Cognome.
Example result
A signed test invoice from a company to a private customer, with two detail lines, produces this summary. The Container line is a reminder that the signature was not checked.
Format: Italian FatturaPA
Container: CMS P7M attachment (signature unverified)
Invoice number: 2026/15
Issue date: 2026-01-20
Seller: Officina Rossi SRL
Buyer: Giulia Bianchi
Total: 366.00 EUR
Line items: 2Why extraction can fail
Most errors come from a variant of the format that the tool does not handle.
- Bare Base64. Some systems deliver the P7M as Base64 text without PEM header lines. The tool expects binary DER or PEM armor, so decode the file to binary first.
- Detached signatures. If the envelope carries only the signature, the tool reports that the P7M file has no embedded content.
- Nested signatures. A file signed twice contains another P7M, not XML, and cannot be decoded.
- Other content. A signed UBL or CII invoice gives Expected a FatturaPA invoice inside the P7M file, and a signed PDF fails with a text decoding or XML error.
- Not a P7M at all. Plain XML or a renamed file is rejected, sometimes with a low-level parser message.
Frequently asked questions
How do I open a .p7m file without installing software?
Choose the file in this tool and select Extract invoice. The browser unwraps the signed envelope locally and shows the invoice fields. The Download link then gives you the plain XML, which any text editor or accounting program can open.
Does the viewer verify the digital signature?
No. It extracts the signed content without checking the signature, the certificate chain or revocation status, and the result says signature unverified. Use qualified signature verification software when you need legal assurance about who signed the file.
Can I open a P7M that contains a PDF or another document?
Not with this tool. It expects the enclosed content to be a FatturaPA XML invoice and stops with an error for anything else. It is a FatturaPA reader, not a general P7M extractor.
What is the difference between .xml and .xml.p7m invoices?
Both carry the same FatturaPA XML. A plain .xml is unsigned or signed inside the XML with XAdES. A .xml.p7m is wrapped in a CAdES envelope, so the XML has to be extracted before it can be read.
Is the signed invoice uploaded anywhere?
No. The ASN.1 parsing and XML reading run in your browser with JavaScript. The file is read from your disk into memory on the page and is not transmitted.
Why does the downloaded file not have the original name?
The tool always names the download invoice.xml. Rename it if your accounting software expects the SdI naming pattern of country code, tax ID and progressive number.