Skip to content

Instantly share code, notes, and snippets.

@aduzsardi
Created July 25, 2017 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aduzsardi/0a016b56978a138169b95754b7a7855c to your computer and use it in GitHub Desktop.
Save aduzsardi/0a016b56978a138169b95754b7a7855c to your computer and use it in GitHub Desktop.
extract files from p7s attachments
#!/bin/bash
openssl pkcs7 -inform DER -in "$1" -print_certs -out "$1.pem"
openssl smime -verify -in "$1" -inform der -noverify -signer "$1.pem" -out "$1.pdf" 2>/dev/null
rm "$1.pem"
evince "$1.pdf"
rm "$1.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment