How To Create Self Signed S/MIME Certificate and install on outlook


Email security become major issue as a lot of viruses, spam, fishing attempts use this method as major platform to attack individual and organization, one way is to sign & encrypt you emails so the receiving part can be 100% sure you are the sender and the email content can be trusted . S/MIME stands for Secure/Multipurpose Internet Mail Extensions . The best way is to buy certificate from trusted authority or try getting one for free valid for one year from here :

However in this tutorial I will Show how to create self-signed certificate with self Authority .Lets begin.

First you will need to install OpenSSL on windows, and you can download it from here : or from here :

all the command you should run from command prompt under the installation directory in BIN folder. Lets say you have install it to :


So run the command from :


First lets create Private key for our Authority :

openssl genrsa -aes256 -out ca.key 4096

enter password for the key. Next Lets create self-sign certificate for our private authority valid for 3650 (10 years)  :

openssl req -new -x509 -days 3650 -key ca.key -out ca.crt

Fill al the information in the wizard in order to create the certificate using the password you have selected before for the private key .

Next lets create an RSA Private Key for the Personal E-Mail Certificate, again you will have to create password for the private key :

openssl genrsa -aes256 -out smime_test_user.key 4096

We should create a file called smime.cnf in C:\OpenSSL-Win64\bin , Create text file->change its name to smime.cnf and enter this content as template for the certificate :

distinguished_name = req_distinguished_name

countryName = Country Name (2 letter code)
countryName_default = AU
countryName_min = 2
countryName_max = 2
stateOrProvinceName = State or Province Name (full name)
stateOrProvinceName_default = Some-State
localityName = Locality Name (eg, city)
0.organizationName = Organization Name (eg, company)
0.organizationName_default = Internet Widgits Pty Ltd
organizationalUnitName = Organizational Unit Name (eg, section)
commonName = Common Name (e.g. server FQDN or YOUR name)
commonName_max = 64
emailAddress = Email Address
emailAddress_max = 40

basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer
subjectAltName = email:copy
extendedKeyUsage = emailProtection

Now we are ready to create CSR; Certificate Signing Request :

openssl req -new -key smime_test_user.key -out smime_test_user.csr

We now ready to create Certificate signed with our Private authority :

openssl x509 -req -days 3650 -in smime_test_user.csr -CA ca.crt -CAkey ca.key -set_serial 1 -out smime_test_user.crt -addtrust emailProtection -addreject clientAuth -addreject serverAuth -trustout -extfile smime.cnf -extensions smime

Now you have created self signed certificate with the Private authority, Although outlook and outher email client use p12 certificate style, Lets create this kind of certificate :

openssl pkcs12 -export -in smime_test_user.crt -inkey smime_test_user.key -out smime_test_user.p12

Enter the password you have created for the private key before . Now you have all the certificates you will need. in order to trust those certificates you will need to install them on the computer.

First install the ca.crt under Trusted Root Certificate authority as this will give the certificate validation, to do so :

run mmc-> file ->add/remove snap-ins-> select certificate -> computer account -> Local computer -> finish

Now Expand certificate and with the left mouse key import ca.crt to Trusted Root Certificate authority -> import smime_test_user.p12 under personal -> make sure the certificate is valid without errors

You shoud do it for both side computer, sender & receiver , is you have created self-signed on the receiver side this certificates should be install on all side (cert exchange) .

Installing the certificate on outlook as describe very nicely at  :

1. In Outlook, select File from the main menu, then click Options.



2. Select Trust Center at the bottom of the menu on the left side of the Outlook Options window.

Click Trust Center


3. Click Trust Center Settings.

Click Trust Center Settings


4. Select Email Security from the left-hand menu of the Trust Center window.

Select Email Security


5. Click Import/Export.

Click Import/Export


6. Make sure Import existing Digital ID from a file is checked, then click Browse…

Click Browse


7. Navigate to the PKCS#12 file, then click Open. The filename extension should be .p12.

Navigate to file


8. Enter the password you used when downloading the PKCS#12 file, then click OK.

Enter password


9. Click OK on the security dialog box that pops up.

Click OK


10. Click Settings.

Click Settings


11. Enter a name for your security settings.

Enter security settings name


12. Click Choose, next to Signing Certificate. If you have only installed one certificate (as shown here), you can click OK on the Confirm Certificate dialog box that pops up. Otherwise, you will have to choose one from a list of installed certificates.

Click Choose

Confirm Certificate


13. Click Choose, next to Encryption Certificate, and click OK on the Confirm Certificate dialog box. Again, if you have more than one certificate, select the same one you chose for Signing Certificate.

Click Choose


14. Click OK to close the Change Security Settings window.

15. Set your desired default options for S/MIME email via the four checkboxes under Encrypted email, then click OK to close the Trust Center Window.

Set S/MIME email options


The certificate is now installed and you can use it to digitally sign and encrypt messages in Outlook.

To send secure email in Outlook:

1. Begin composing a new email message in Outlook. Under Options, you can toggle the encryption and/or digital signature settings for the message.

S/MIME options


2. After sending, click Allow in the Windows Security dialog box that appears, allowing Outlook to use your private key.

Security dialog box


3. Note that if you attempt to send encrypted email and do not have your recipient’s public key, you will get an error message giving the option to send the message unencrypted.

Error message


When trying to send encryped email you might get error : valid certificate :

To Fix this you can import the certificate smime_test_user.p12 :

1. Open control panel, navigate to Network and Internet-> Internet Options.
2. In prompt Internet Properties Window, select “Content” tab->Click on “Certificates” button.
3. In prompt Certificate window, select “Personal” tab->Select the certificate you applied for and issued to your current account.

You can import again from there again the certificate

Good Luck


  • FDK says:

    Hi from France !

    I use Windows 10 Pro on a desktop computer.

    I downloaded OpenSSL v1.1.1g Light (Platform : VC-WIN64A) from the first recommended site :

    Problem : I can’t enter any password for the ca.key in the Win64 OpenSSL Command Prompt. The cursor is just blinking and that’s all… 🙁

    What should I do please ?

    Thanks in advance. 🙂


  • Ian Spencer says:

    this is a brilliant guide I’ve followed all steps and successfully imported

    however when I’m come to encrypt email outlook comes up saying “Microsoft Outlook had problems encrypting this message because the following receipts had missing or invalid certificates or conflicting or unsupported encryption capabilities, which I understand – however continue is greyed out.


  • Mike says:

    Hello, nice process. Easy to understand. In trying to create a certificate signed with private authority, I received an error message indicating the following: error on line 1 of config file ‘smime.cnf’. I copied the text exactly as shown, pasted into a text file and changed the extension to .cnf.

    Your help is greatly appreciated.

    • admin says:

      notice that the example file is just as it say !
      countryName = Country Name (2 letter code) -> you need to enter the counrty code like =US or IT or RU …….

  • Saadeh says:

    this was really great help
    i have a question
    how can i create certificates for more than one email or account

    • admin says:

      For each address you should have one mime certificate, then you can choose it when sending sign email from that address

  • Mike says:

    I am getting an error “Unable to load config info from /usr/local/ssl/openssl.cnf”

Leave a Reply

Your email address will not be published. Required fields are marked *