Tom Auger (taugr)

Coding, researching, and teaching with AI

August 10, 2018 ยท 5 min read
OpenSSL

How to create a self signed RSA certificate with OpenSSL

Archived from the old blog. Original URL: https://tomauger.gitlab.io/posts/2018-08-10-creating-self-signed-certificate-openssl/.

Reference of commands to create a self signed RSA certificate with OpenSSL

To create a certificate with private key:

openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out certificate.pem

Print out the certificate meta data:

openssl x509 -text -noout -in certificate.pem

Generate a P12 with the certificate and key:

openssl pkcs12 -inkey key.pem -in certificate.pem -export -out certificate.p12

Validate the P12:

openssl pkcs12 -in certificate.p12 -noout -info

References