Fattura .p7m ENEL ENERGIA non convertibile

Buongiorno a tutti,
ecco il file file p7m incriminato
su decine di fatture ho problema a decifrare una .p7m di ENEL ENERGIA (solo questa, le altre di ENEL non mi danno problemi)

Uso il comando Openssl:
openssl smime -verify -noverify -in file.pem -inform DER -out file.xml 2>&1

Solo su questa mi restituisce questo errore
Error reading S/MIME message
10380:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:.\crypto\asn1\tasn_dec.c:1316:
10380:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:.\crypto\asn1\tasn_dec.c:380:Type=PKCS7_ISSUER_AND_SERIAL
10380:error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 error:.\crypto\asn1\tasn_dec.c:748:Field=issuer_and_serial, Type=PKCS7_SIGNER_INFO
10380:error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 error:.\crypto\asn1\tasn_dec.c:709:Field=signer_info, Type=PKCS7_SIGNED
10380:error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 error:.\crypto\asn1\tasn_dec.c:748:
10380:error:0D08403A:asn1 encoding routines:ASN1_TEMPLATE_EX_D2I:nested asn1 error:.\crypto\asn1\tasn_dec.c:578:Field=d.sign, Type=PKCS7

Ho provato ad estrarre il certificato con il comando OPENSSL
openssl pkcs7 -inform DER -in file.p7m -print_certs -out cert.pem 2>&1

e, sempre solo per questa fattura, non me lo estrae e mi genera il seguente errore

unable to load PKCS7 object
11072:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:.\crypto\asn1\tasn_dec.c:1316:
11072:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:.\crypto\asn1\tasn_dec.c:380:Type=PKCS7_ISSUER_AND_SERIAL
11072:error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 error:.\crypto\asn1\tasn_dec.c:748:Field=issuer_and_serial, Type=PKCS7_SIGNER_INFO
11072:error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 error:.\crypto\asn1\tasn_dec.c:709:Field=signer_info, Type=PKCS7_SIGNED
11072:error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 error:.\crypto\asn1\tasn_dec.c:748:
11072:error:0D08403A:asn1 encoding routines:ASN1_TEMPLATE_EX_D2I:nested asn1 error:.\crypto\asn1\tasn_dec.c:578:Field=d.sign, Type=PKCS7

Non so più dove sbattere la testa :face_with_monocle:

Come già suggerito in altri thread, prova a sostituire il parametro comando di openssl da smime a cms.

Grazie, appena riuscito dopo 2 giorni…

ho aggiornato openssl e cambiato in
openssl cms -verify -noverify -in 'file.p7m -inform DER -out file.xml 2>&1

grazie grazie

Salve Paolo
dove trovo l’applicativo Openssl? E’ gratuito? GRAZIEE

Buongiorno,
Googla e lo trovi… è un applicativo da riga da comando

Io però ancora oggi ho dei problemi ad estrarre alcuni p7m