How to encrypt E-Mails with S/MIME

I am considering to encrypt some of my mails using S/MIME v3.1, since my devices should support it.

Now I wonder if there is a (command line) tool that could do that for me? I tried to google it, but I did not found something promissing.


Solution 1:

Yes, OpenSSL (openssl smime or openssl cms) can do that:

man smime:

DESCRIPTION

The smime command handles S/MIME mail. It can encrypt, decrypt, sign and verify S/MIME messages.

man cms:

DESCRIPTION

The cms command handles S/MIME v3.1 mail. It can encrypt, decrypt, sign and verify, compress and uncompress S/MIME messages.