Archive
Converting a PFX file to PEM and Key via openssl
For some wierd reason, although the steps are simple, i cannot easily find a single page which gives you the exact steps (only 4) to convert a pfx file to a PEM and a KEY file
below are the steps to convert, it will generate an aa_s.key and a aa.pem which you can then use to put into your system e.g apache, hmailserver etc
REM Set the path to include the openssl directory
set path=%path%;C:\OpenSSL\bin;
REM Export the private key
openssl pkcs12 -in aa.pfx -out aa.key -nocerts -nodes
REM take out the encryption from the private key
openssl rsa -in aa.key -out aa_s.key
REM export the ssl cert (normal cases)
openssl pkcs12 -in aa.pfx -out aa.pem -nokeys -clcerts
REM export the ssl cert (Crescendo load balancers)
openssl pkcs12 -in a.apfx -out aa_tmp_cn.pem -nodes
openssl x509 -in aa_tmp_cn.pem -out aa_cn.pem -text
REM Verification: run the following 2 commands, the output should be exactly the same
openssl x509 -noout -modulus -in aa.pem | openssl md5
openssl x509 -noout -modulus -in aa_cn.pem | openssl md5
openssl rsa -noout -modulus -in aa_s.key | openssl md5
Done!
System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Office Excel cannot access the file
You may encounter this error when trying to run excel automation via IIS.
There are several links pointing to this issue with the resolution found at
I’m reproducing the same information here for ease of resolution
- Create directory “C:\Windows\SysWOW64\config\systemprofile\Desktop ” (for 64 bit Windows) or “C:\Windows\System32\config\systemprofile\Desktop ” (for 32 bit Windows)
- Set Full control permissions for directory Desktop (for example in Win7 & IIS 7 & DefaultAppPool set permissions for user
“IIS AppPool\DefaultAppPool”)