#!/usr/bin/bash

if (( $# >= 2 )); then
     echo -e "SMIME encrypt a message with OpenSSL (to be emailed)" 
     openssl smime -encrypt -aes-256-cbc -in $1 -binary  -out $1.smime -from bob@sender.com  -to alice@receiver.com -subject "Encrypted message"   $2 
     ls -l $1.smime
else
     echo "usage: encryptSMIME messagefile certificate"
fi 
