For this tutorial, you'll need keystore containing the private key, so you can create a certificate signing request for it. If you already have keystore, you can skip step 1.

Step 1. Create keystore with the private key in it.

keytool -genkey -alias server -keyalg RSA -keysize 2048 -keystore keystore.jks -dname "CN=p1, O=o1, L=Belgrade, ST=, C=RS"

Step 2. Create CSR based on keystore that you have.

keytool -certreq -alias server -file cerificateSigningRequestABC.csr -keystore keystore.jks