Difference between revisions of "Firma Digitale - Aprire file con estensione p7m"

From Web
Jump to navigation Jump to search
(Created page with "__FORCETOC__ == In windows == Per aprire i file p7m in windows consigliamo * [https://www.firma.infocert.it/installazione/ go-sign] (il vecchio Dike) di infocert * [https://w...")
 
Line 5: Line 5:
 
* [https://www.firma.infocert.it/installazione/ go-sign] (il vecchio Dike) di infocert
 
* [https://www.firma.infocert.it/installazione/ go-sign] (il vecchio Dike) di infocert
 
* [https://www.pec.it/download-software-driver.aspx arubasign], ma quest'ultimo e' piu' lento.
 
* [https://www.pec.it/download-software-driver.aspx 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

Revision as of 14:28, 1 June 2021


In windows

Per aprire i file p7m in windows consigliamo

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