Requirement: Create a self signed certificate for SSL with private key and public key
Solution:
The following command can be used to create private key and public key.
makecert -r -pe -n "CN=mycompany.com" -b 08/07/2015 -e 08/07/2040 -sky exchange Server.cer -sv Server.pvk
pvk2pfx.exe -pvk Server.pvk -spc Server.cer -pfx Server.pfx
Additional Details:
To understand the command more in details, please refer below link: