openssl generate self signed certificate public key code example

Example 1: openssl generate self signed certificate

openssl.exe genrsa -out <yourcertname>.key 4096

openssl.exe req -new -key yourcertname.key -out yourcertname.csr

Example 2: openssl create certificate with private key

---
Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:New York
Locality Name (eg, city) []:Brooklyn
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Example Brooklyn Company
Organizational Unit Name (eg, section) []:Technology Division
Common Name (e.g. server FQDN or YOUR name) []:examplebrooklyn.com
Email Address []: