How To Create Self Signed Certificate Using Java Keytool

How To Create Self Signed Certificate Using Java Keytool : This post is especially for those who are developers and looking for a easy method to create self signed certificate using Java Keytool. Java Keytool is one of the tool used to generate and practice lot of advance feature where one can manage and add certificates, also you can add root certificates/ client certificates. You can do allot of new things with Java Keytool. So here we are telling you one method which is very easy on how to create self signed certificate using Java Keytool. Don’t worry if you don’t know much about Java Keytool and using it just to add self signed certificate, we’ll guide you though the entire process. You can easily add/create self signed certificate using Java Keytool without any difficulty. This post is suitable even for beginners who are new to Java Keytool. So here we are with the process on how to create self signed certificate using Java Keytool for beginners as well as advance users.

Read More : How to keep personal files safe in Windows 10

Create Self Signed Certificate Using Java Keytool

How To Create Self Signed Certificate Using Java Keytool

How To Create Self Signed Certificate Using Java Keytool : For Beginners

Before the process, you must know what is SSL Certificate.  An SSL certificate serves two essential purposes

  • Distributing public key and it’ll verify the identity of the server. It protects user from sending the information to wrong server.
  • It can verify the identity of the server as soon as it is signed by a yourself.

Self signed certificate is not that safe. So it has some places where it has to be used. You can use Self Signed Certificate on a personal website with few visitors, intranet and while testing an application Self signed Certificate is used where you require to test an application. Also, you don’t want to buy trusted certificate. So here we are with the process on how to create self signed certificate using Java Keytool.

Method on How To Create Self Signed Certificate Using Java Keytool :

This is the easiest of all the method to create self signed certificate using Java Keytool. So here we start.

  • Open the command console your system.
  • Navigate to the directory where keytool.exe is located.
  • This is usually in Program Files in Windows and you can locate it as per your operating system.
  • Type this command and run it.

keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -storepass password -validity 360 -keysize 2048

Create Self Signed Certificate Using Java Keytool

How To Create Self Signed Certificate Using Java Keytool

  • Here above validity is the number of days before the certificate expires. Choose as appropriate.
  • It’ll be asking for details which are required to access the certificate. Enter the domain name of the server that users will be entering to connect to your application.
  • Enter the appropriate details as asked and follow the steps.
  • This will create a .jks file which contains a private key and your self signed certificate. Now you just need to configure your Java application to use the .jks file.

So, this all you have to do to create Self Signed Certificate Using Java Keytool. This is one of the easiest way to create and use Self Signed Certificate. Don’t worry nothing will cost you to make one.

Note : When you’ll try to access it. It’ll say

The security certificates presented by this website was not issued by a trusted certificate authority.


Above are some How To Create Self Signed Certificate Using Java Keytool. If you face any problem or have any query related to this article then feel free to contact us by commenting below. If it helps you then return us the favor by sharing it with your friends on Facebook, Twitter or Google Plus. For more such useful articles. Prefer SUBSCRIBING us on techcrises.com or follow us on Facebook.

Thank You.

Leave a Reply

Your email address will not be published. Required fields are marked *