Firma Digitale - Aprire file con estensione p7m

From Web
Revision as of 16:59, 1 June 2021 by Acorni (talk | contribs) (→‎In windows)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


In windows

Per aprire i file p7m in windows consigliamo

  • go-sign di Infocert - consigliato.
    Non e' da installare come Administrator, va scaricato ed installato dall'utente che lo usa.
  • arubasign, ma quest'ultimo e' piu' lento.

In Linux - gnome

Si puo' provare questo script

#!/bin/bash
#
# @author Alberto Corni
# [Al 20190114-12:30] https://askubuntu.com/questions/590795/getting-rid-of-the-p7m-file-extension
#
  fn="$1"
  f(){
      bn=`basename "$fn"`
      openssl pkcs7 -inform DER -in "$fn" -print_certs -out "/tmp/$bn.pem"
      openssl x509 -text -in "/tmp/$bn.pem" -out "/tmp/$bn.pem.txt"
      openssl smime -verify -in "$fn" -inform der -noverify -signer "/tmp/$bn.pem" -out "/tmp/$bn.pdf"
      if [ $? -eq 0 ]
      then
          # less "/tmp/$bn.pem.txt"
          # nautilus "/tmp/$bn.pdf"
          xdg-open "/tmp/$bn.pdf"
          echo Firma corretta - OK!
          cat "/tmp/$bn.pem.txt" 
      else
          echo ERROR decrypting - firma non valida
          rm "/tmp/$bn.pem.txt" "/tmp/$bn.pdf"
      fi
  }
  f 2>&1 | cat | less
  exit

e queste sono le istruzioni per configurarlo come applicazione Gnome3.

Ricordarsi di cambiare il path /home/corni/scripts/p7mverify.sh

  #
  #
  # gnome install as app
  #
  #
  cat <<'  EOF' > ~/.local/share/applications/p7mverify.desktop
[Desktop Entry]
Version=1.0
Name=P7m Verifier
GenericName=P7m Verifier
Comment=Consente di estrarre e verificare il contenuto di file p7m o 
MimeType=
TryExec=/home/corni/scripts/p7mverify.sh
Exec=/home/corni/scripts/p7mverify.sh %f
Icon=gcr-smart-card
Type=Application
Terminal=true
Categories=Utility
Keywords=p7m;pdf;signature;firma;elettronica;verifica
  EOF