How To Java Programming Uncategorized
How to Code Signing to Your Java Project
January 9, 2018

Recently I was developing an App using Java that will be launched from Website Directly using JNI Technique. I have created a Jar file. But problem is your Jar File will be not leaded or run if the Jar File is not signed with any Code Signing Certificate.


You must generate the CSR from your local machine and not from the web server you’re using to host the file.

Windows-only preparation

If you use Windows, you must complete the following steps before generating your CSR.

  1. Run cmd as an administrator, If you are using windows8:
    Click start button
    In the search box, type command prompt
    From the result, right-click command prompt and click Run as administrator. Then execute the keytool command.
  2. Move to your JDK installation’s bin directory:
    cd C:\Program Files\java\jdkversion number\bin



  1. Create a keystore called codesignstore:
    keytool -genkey -alias codesigncert -keyalg RSA -keysize 2048 -keystore codesignstore
  2. Complete the information requested from you at the command prompt. There are a few important things to note:
    • It’s important that this information is consistent with everything else you plan to use in your request.
    • You will have to provide a password and note your keystore’s password because you must have it to sign your Java code.


Generate your CSR:

keytool -certreq -v -alias codesigncert -file mycsr.pem -keystore codesignstore

  1. Enter your keystore’s password and press enter.
  2. Open your CSR. How you do that depends on your OS:
    OS Command
    Mac OS X
    nano mycsr.pem
    start notepad "mycsr.pem"
  3. Copy your CSR, including the entirety of the lines containing BEGIN NEW CERTIFICATE REQUEST and END NEW CERTIFICATE REQUEST.


  1. Log in to your GoDaddy account.
  2. Click SSL Certificates.
  3. Next to the SSL certificate credit you want to use, click Set up.
  4. If you have multiple credits, select the credit you want to use, and then click Set up.
  5. Refresh the page; you should see a New Certificate. If you don’t, continue to refresh the page until you do.


  1. Next to your New Certificate, click Manage.
  2. Paste the CSR you generate in the CSR field, and then click Next.
  3. Enter your organization’s information – which has to match the information you used when creating your CSR – and then click Finish.


After requesting certificate GoDaddy validate that you control the domain name which you’re trying to secure.

About author


Honeypot !!!!

Recently I was developing an App using Java that w...

Read more

How to Study

Recently I was developing an App using Java that w...

Read more


Recently I was developing an App using Java that w...

Read more

There are 0 comments

Leave a Reply

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