openssl create certificate and private key code example
Example 1: generate key and certificate openssl
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365
Example 2: openssl create certificate with private key
-subj "/C=US/ST=New York/L=Brooklyn/O=Example Brooklyn Company/CN=examplebrooklyn.com"