Sometimes you need to generate a quick certificate to test your app. Using openssl you can easily accomplish this, take a look at my example below:

openssl req -new -newkey rsa:1024 -days 365 -nodes -x509 -keyout QA.key -out QA.cert
 
# Merge cert and private key to make a p12 file, this file will be used by .NET's X509Certificate2 class, The private key will be accessible via the "PrivateKey" property
openssl pkcs12 -export -in qa.cert -inkey qa.key -out qa.p12 -name "QA"