I need to create a certificate for email encryption and signing that has to be used by Outlook 2003+. I'm using OpenSSL, my self-signed root-CA is already imported into the trusted root-CA store. These are my steps to create a p12 Identity file importable by Outlook:
openssl req -batch -newkey rsa:1024 -keyout KEY.key -out KEY.csr \
-nodes -config openssl.cnf &&\
openssl x509 -req -sha1 -days 1000 -in KEY.csr -CA ca.crt -CAkey ca.key \
-set_serial 1 -out KEY.crt -setalias "FRIENDLY_NAME" \
-clrtrust -addtrust emailProtection \
-addreject clientAuth -addreject serverAuth -trustout &&\
openssl pkcs12 -export -in KEY.crt -inkey KEY.key" -out KEY.p12 \
-name "FRIENDLY_NAME" -passout pass:PASSWD &&\
chmod 0600 KEY_CN.{key,p12} &>/dev/null
Here is the relevant segment of my openssl.cnf
:
[ usr_cert ]
basicConstraints = CA:FALSE
authorityKeyIdentifier = keyid
subjectKeyIdentifier = hash
keyUsage = critical, digitalSignature, keyEncipherment
extendedKeyUsage = critical, emailProtection
subjectAltName = email:copy
authorityKeyIdentifier = keyid
subjectKeyIdentifier = hash
I inspected another valid p12 file to get these settings - and the -name
cli option in the 3rd openssl-statement above.
My problem: Outlook still chokes on this (it's valid in Thunderbird, though). I don't have the English error message (could provide the German one, though), these are the rough translations of the dialogs I see:
- "Grant usage of a key to the application: Grant / do not grant" (you may show key details in the lower left - it says there is no description and no context information)
- "Repeat the procedure. The protected key cannot be accessed, make sure the specified password is valid." (I did - I even tried every possible variation of password/no password in openssl and Outlook! For the next step, I'm led back to the first dialog and click "Cancel")
- "Error in the underlying security system. Access denied!"
My current setup in Outlook: Sign emails, transfer text and signature in plaintext and attach the certificate. I also restricted the certificates usage to secureEmail and disabled OCSP. When importing the certificate (and on generation) I used the exact same password for every password request and the same description as friendlyName, CN and alias (maybe these can be different, I just didn't want to risk anything while trying).
I really don't get what Outlook doesn't like / wants to tell me. If needed, I will gladly provide additional details.
Thanks!