An S/MIME certificate is a digital certificate (X.509-based) that enables you to:
Email encryption and decryption
Protecting message confidentiality by ensuring only the intended recipient can read the content.
Email and documenent signing
This ensuring message or documents integrity (no tampering) and authenticity (verifying identity).
Unlike TLS (which only protects email while in transit), S/MIME ensures end-to-end security between you and your recipient. Certificates can be self-signed, but using a trusted Certificate Authority (CA) makes validation easier and improves trustworthiness
The Key Pair we will create can then be used to sign, verify, encrypt, and decrypt email.
This creates a encrypted and password protected RSA private 4096 bit key.
Keep password safe in your favorite password manager (do not share it).
Recommendation: New and uniqe password (not used elsewhere), 20 characters or more, local random password generators creates better password than humans.
openssl genrsa -aes256 -out myemailaddress.key 4096
Tip: Never use online services to create Private Key or the CSR. The service may save a copy of your key.
Use your private key (password needed) to generate a Certificate Request (CSR), which you’ll submit to a CA or use for self-signing.
The only thing you need to add is Common Name (CN) and Email. Use dot (.) on all the others.
openssl req -new -key myemailaddress.key -out myemailaddress.csr
This is just verificatio step to make sure everything lock correct before sending to CA for signing.
If not correct remove the csr file and do step 2 again.
openssl req -new -key myemailaddress.key -out myemailaddress.csr
You have two options:
This example is for Outlook email client. You need to create a bundle of the certificate and private key (password needed) in PKCS12 format.
You do NOT need to add the CA chain.
openssl pkcs12 -export -in myemailaddress.pem -inkey myemailaddress.key -out myemailaddress.pfx
Once issued, install the certificate along with your private key:
If you want to publish your certficate or share with someone before communicating DER format makes it easy import for example on Windows platform.
PEM vs DER, the difference is the encoding format (text/Base64 vs binary)
-----BEGIN CERTIFICATE-----
.pem, .crt, .cer, .key
.der, .cer
openssl x509 -in myemailaddress.pem -out myemailaddress.der -outform DER
Share the certificate file with the .der
extension.
Start by sending a digitally signed email — this shares your public certificate with the recipient. Once you receive their certificate, you can send encrypted emails.