openssl genrsa -out privatekey.pem 2048 openssl req -new -key privatekey.pem -out csr.pem openssl x509 -req -days 365 -in csr.pem -signkey privatekey.pem -out certificate.pem openssl pkcs12 -export -out certificate.p12 -inkey privatekey.pem -in certificate.pem -certfile certificate.pem