#!/usr/bin/bash

if (( $# >= 3 )); then
     echo -e "Decrypt a SMIME message with OpenSSL" 
     openssl smime -decrypt -in $1  -out $1.clear -recip $2 -inkey $3 -passin pass:deadbeefdead
     ls -l $1.clear
else
     echo "usage: decryptSMIME file certificate privatekey"
fi 
