S/MIME decoder

I wrote this simple tool because I was sometimes receiving S/MIME signed messages with non-detached signatures that couldn't be easily read in console mail readers (e.g. in pine). Of course I could have used openssl smime command line tool, but it needs some weird parameters to work. So I took this opportunity to write something that uses the OpenSSL library.

It can work either as a filter in which case it doesn't take any argument, or it can take a filename as an argument.

Get the source
smime-decode.c (Colorized)
Compile
$ gcc -o smime-decode smime-decode.c -lcrypto
Get the test file
signed with a detached or embedded signature
Test it
$ ./smime-decode test.txt.detached
This is a funny message, isn't it?
********************
[Detached signature verified]
 
$ ./smime-decode test.txt.embedded
This is a funny message, isn't it?
********************
[Embedded signature verified]