How to Create self signed certificate using OpenSSL/Keytool

Posted by

Create self signed certificate using OpenSSL

– Generate a Private Key

openssl genrsa -des3 -out server.key 1024

– Generate a CSR

openssl req -new -key server.key -out server.csr

– Generating a Self-Signed Certificate

openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

Signature ok
subject=/C=US/ST=****/L=****/O=****/OU=***/CN=devopsunixandjava.com/emailAddress=devopsunixandjava@gmail.com

Create self signed certificate using Keytool

keytool -genkey -keyalg RSA -alias tomcat -keystore keystore -validity -keysize 2048

– Verify contents using below command

keytool -list -v -keystore keystore

Leave a Reply

Your email address will not be published.