Windows – Creating a signing certificate for Outlook 2010 under Windows 7

certificatemicrosoft-outlook-2010windows 7

I'm trying to create a S/MIME signing certificate for Outlook 2010 under Windows 7. I've gone into Options ➮ Trust Center (see below) to try and set it up but when I attempt to select the signing certificate I get an error message: "No certificate available".

How do you create a self-signed certificate for signing emails?

Trust Center
Trust Center

No Certificate Error
No Certificate error

Best Answer

I was using the Microsoft tool makecert for this.

First you need to create a CA (Certificate Authority) key:

makecert -pe -n "CN=My Root CA" -ss root -a sha512 -sky signature -len 2048 -h 1 -cy authority -r my_ca.cer
# -pe: Mark private key as exportable - useful for backup.
# -n "CN=My Root CA": The name of the certificate. Please use an individual name and replace the "My" with your full name.
# -ss root: The store where makecert shall place the certificate (Root certificates store).
# -a sha512: The signature algorithm to use. Right now SHA512 is the maximum available.
# -sky signature: The key type (signature, not exchange).
# -len 2048: Key length in bits. You might consider generating a longer key.
# -h 1: Maximum height of the tree below this certificate. I don't use sub-CAs, so I hope that 1 is the correct value.
# -cy authority: Certificate type is CA, not end-entity.
# -r: Create a self signed certificate.
#  my_ca.cer: Name of the file to which the generated public key will be written.

Now you need to create the certificate(s) for mail signing. In your case you will start with only one certificate for you:

makecert -pe -n "E=my.mail@addre.ss,CN=My eMail Signing" -a sha512 -sky exchange -cy end -ss my -eku 1.3.6.1.5.5.7.3.4 -in "My Root CA" -is root -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12 -len 2048 my_email.cer 
# -pe:Mark private key as exportable - useful for backup.
# -n "E=my.mail@addre.ss,CN=My eMail Signing": Name of the certificate. This must contain your mail address in the E entry and your name in the CN entry. You should give a useful CN, so please replace My with your full name.
# -a sha512: The signature algorithm to use. Right now SHA512 is the maximum available.
# -sky exchange: The key type (exchange, not signature).
# -cy end: Certificate type is end-entity, not CA.
# -ss my: The store where makecert shall place the certificate (My certificates store).
# -eku 1.3.6.1.5.5.7.3.4: Enhanced key usage "E-mail protection"
# -in "My Root CA": Name of the CA used to sign the generated key. Must be the same as given in "-n" in the above call to makecert.
# -is root: Store where the CA key can be found.
# -sp "Microsoft RSA SChannel Cryptographic Provider": Name of the CryptoAPI provider to use.
# -sy 12: Type of the CryptoAPI provider.
# -len 2048: Key length in bits. You might consider generating a longer key.
# my_email.cer: Name of the file to which the generated public key will be written.

The private and public keys will be written to the user's certificate stores (in the registry) and can be used immediately. The public keys will be written to the given files.

On your computer you can immediately select the mail signing certificate in your mail program. To give your public keys to others you can give them a copy of your public keys. For full trust they might need to import your CA key into their certificate store.

Related Question