{"id":42,"date":"2020-02-22T16:08:07","date_gmt":"2020-02-22T16:08:07","guid":{"rendered":"https:\/\/codesigncert.com\/blognew\/how-to-sign-java-files-with-java-code-signing\/"},"modified":"2026-07-24T13:40:50","modified_gmt":"2026-07-24T13:40:50","slug":"how-to-sign-java-files-with-java-code-signing","status":"publish","type":"post","link":"https:\/\/codesigncert.com\/blog\/how-to-sign-java-files-with-java-code-signing","title":{"rendered":"How to Sign Java Files with Java Code Signing Certificate &#8211; Quick Guide"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 ez-toc-wrap-right counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"#\" data-href=\"https:\/\/codesigncert.com\/blog\/how-to-sign-java-files-with-java-code-signing\/#Prerequisite\" >Prerequisite<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"#\" data-href=\"https:\/\/codesigncert.com\/blog\/how-to-sign-java-files-with-java-code-signing\/#Creating_the_Keystore\" >Creating the Keystore<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"#\" data-href=\"https:\/\/codesigncert.com\/blog\/how-to-sign-java-files-with-java-code-signing\/#Generating_the_CSR\" >Generating the CSR<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"#\" data-href=\"https:\/\/codesigncert.com\/blog\/how-to-sign-java-files-with-java-code-signing\/#Signing_jar_file_with_Jarsigner\" >Signing .jar file with Jarsigner<\/a><\/li><\/ul><\/nav><\/div>\n<div class=\"col-lg-12 mb-3 p-2\">\n<p>Java has become one of the most commonly used programming languages in the last few decades. With such a huge fan base, it has become very important to create the legitimacy for the line of codes written on Java. That is why, Java is highly dependent on code signing which in turn helps the developers to keep their identity intact to the end user. The digital signature for Java is mainly done using the Java code signing certificate.<\/p>\n<p>This quick guide is going to help you on how you can sign .jar or any other extension using the Java code signing language.<\/p>\n<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Prerequisite\"><\/span>Prerequisite<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li>The Java Development Kit (JDK) properly installed<\/li>\n<li>Correctly installed and properly configured signing tool<\/li>\n<li>Download the same from <a href=\"http:\/\/java.sun.com\/javase\/downloads\/index.jsp\">http:\/\/java.sun.com\/javase\/downloads\/index.jsp<\/a><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Creating_the_Keystore\"><\/span>Creating the Keystore<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In order to create the keystore for the generation of public\/private key pair, you need to enter the following command.<\/p>\n<p><strong><em>Mention the name of your keystore along with an alias<\/em><\/strong><\/p>\n<p>keytool -genkey -keyalg rsa -keystore &lt;keystore_filename&gt;<\/p>\n<p>-alias &lt;alias_name&gt; -keysize 2048<\/p>\n<p>Note: Keep the key bit size at 2048 bit.<\/p>\n<p>After successfully executing the command, you would need to create a password for your keystore along with your name, organization and the address. The key pair that you have generated will be stored at the keystore so that you can use the same while signing into a Java Applet or any other application.<\/p>\n<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Generating_the_CSR\"><\/span>Generating the CSR<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span style=\"text-decoration: underline;\">STEP 1<\/span><\/h3>\n<p>You will be needing to generate the Certificate Signing Request (CSR) for the completion of the entire enrolment process.<\/p>\n<p>Use the following command to request the keytool to create the CSR in the keystore for the keypair.<\/p>\n<p>keytool -genkey -alias server -keyalg RSA -keysize 2048<\/p>\n<p>-keystore Examplekeystore.jks<\/p>\n<h4><span style=\"text-decoration: underline;\">STEP 2<\/span><\/h4>\n<p>Once you have successfully executed the command, enter the information as requested:<\/p>\n<p>Enter keystore password:<br \/> Re-enter new password:<br \/> What is your first and last name?<br \/> [Unknown]: Firstname Lastname or YourCompanyName<br \/> What is the name of your organizational unit?<br \/> [Unknown]: YourDepartment<br \/> What is the name of your organization?<br \/> [Unknown]: YourCompanyName or Firstname Lastname<br \/> What is the name of your City or Locality?<br \/> [Unknown]: YourCity<br \/> What is the name of your State or Province?<br \/> [Unknown]: YourState or YourProvince<br \/> What is the two-letter country code for this unit?<br \/> [Unknown]: US<br \/> Is CN=YourCompanyName or Firstname Lastname, OU=YourDepartment, O=YourCompanyName or Firstname Lastname, L=YourCity, ST=YourState, C=US correct?<br \/> [no]: yes<br \/> Enter key password for <br \/> (RETURN if same as keystore password):<\/p>\n<p>Once you have completed the above step, a Java keystore file with the name Examplekeystore.jks will be generated.<\/p>\n<h4><span style=\"text-decoration: underline;\">STEP 3<\/span><\/h4>\n<p>Now, run the command to generate the CSR through the keystore<\/p>\n<p>keytool -certreq -alias server -file csr.csr -keystore Examplekeystore.jks<\/p>\n<p><strong><em>Once the command has been executed correctly, you would be greeted with a message &ldquo;Certificate reply was installed in keystore&rdquo;<\/em><\/strong><\/p>\n<p><strong><em>Type &lsquo;Yes&rsquo; and your code sign certificate will be successfully installed.<\/em><\/strong><\/p>\n<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Signing_jar_file_with_Jarsigner\"><\/span>Signing .jar file with Jarsigner<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Once you have executed the above steps completely, you can now verify your signature for the .jar files on Jarsigner.<\/p>\n<h4><span style=\"text-decoration: underline;\">STEP 1<\/span><\/h4>\n<p>Use the following command to sign the file.<\/p>\n<p>arsigner -tsa http:\/\/timestamp.&lt;certificate-authority&gt;.com -keystore c:pathtoyourExamplekeystore.jks -storepass ExamplePassword c:pathtoyourfile.jar ExampleAlias<\/p>\n<p>Note: Don&rsquo;t forget to replace the ExamplePassword with your current password.<\/p>\n<h4><span style=\"text-decoration: underline;\">STEP 2<\/span><\/h4>\n<p>To verify that the .jar file was successfully signed, run the following jarsigner verifying command.<\/p>\n<p>jarsigner -verify -verbose -certs c:pathtoyourfile.jarjarsigner -verify -verbose -certs c:pathtoyourExamplefile.jar<\/p>\n<h4><span style=\"text-decoration: underline;\">STEP 3<\/span><\/h4>\n<p>Once the code has been successfully signed, you will be prompted with the following output:<\/p>\n<p>s = signature was verified<\/p>\n<\/p>\n<div style=\"width: 100%; float: left; margin: 30px 0; border: 5px solid #d6d6d6; border-radius: 5px;\">\n<div style=\"width: 100%; float: left; background-color: #108ab3;\">\n<div class=\"container\" style=\"text-align: center;\">\n<div style=\"padding-left: 20px;\">\n<h3 style=\"font-size: 24px; text-decoration: underline; line-height: 30px; color: #ffffff; font-weight: bold; padding: 15px 0;\"><a href=\"https:\/\/codesigncert.com\/codesigning\/java-codesigning\" target=\"_blank\" style=\"color: #fff;\">Buy Java Code Signing Certificate at Only $59<\/a><\/h3>\n<\/div>\n<\/div>\n<\/div>\n<\/div><\/div>\n<div class=\"col-lg-12 mt-5 mb-4\">\n<h4 class=\"text-primary mb-4 pb-2 border-bottom\">Related Articles<\/h4>\n<div class=\"row g-4\">\n","protected":false},"excerpt":{"rendered":"<p>A complete step-by-step mechanism to sign java files with java code signing certificate in few minutes. Read now.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-42","post","type-post","status-publish","format-standard","hentry","category-code-signing"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Sign Java Files With a Java Code Signing Certificate<\/title>\n<meta name=\"description\" content=\"Learn how to sign JAR files using jarsigner and a Java code signing certificate to pass security checks and remove browser warnings.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/codesigncert.com\/blog\/how-to-sign-java-files-with-java-code-signing\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Sign Java Files With a Java Code Signing Certificate\" \/>\n<meta property=\"og:description\" content=\"Learn how to sign JAR files using jarsigner and a Java code signing certificate to pass security checks and remove browser warnings.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codesigncert.com\/blog\/how-to-sign-java-files-with-java-code-signing\" \/>\n<meta property=\"og:site_name\" content=\"CodeSignCert\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codesigncert\" \/>\n<meta property=\"article:published_time\" content=\"2020-02-22T16:08:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-07-24T13:40:50+00:00\" \/>\n<meta name=\"author\" content=\"Jessica Foster\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codesigncert\" \/>\n<meta name=\"twitter:site\" content=\"@codesigncert\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jessica Foster\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/codesigncert.com\\\/blog\\\/how-to-sign-java-files-with-java-code-signing#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/codesigncert.com\\\/blog\\\/how-to-sign-java-files-with-java-code-signing\"},\"author\":{\"name\":\"Jessica Foster\",\"@id\":\"https:\\\/\\\/codesigncert.com\\\/blog\\\/#\\\/schema\\\/person\\\/9af8cbd9dd564d4534f25cd63a48d02d\"},\"headline\":\"How to Sign Java Files with Java Code Signing Certificate &#8211; Quick Guide\",\"datePublished\":\"2020-02-22T16:08:07+00:00\",\"dateModified\":\"2026-07-24T13:40:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/codesigncert.com\\\/blog\\\/how-to-sign-java-files-with-java-code-signing\"},\"wordCount\":622,\"articleSection\":[\"Code Signing\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/codesigncert.com\\\/blog\\\/how-to-sign-java-files-with-java-code-signing\",\"url\":\"https:\\\/\\\/codesigncert.com\\\/blog\\\/how-to-sign-java-files-with-java-code-signing\",\"name\":\"How to Sign Java Files With a Java Code Signing Certificate\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/codesigncert.com\\\/blog\\\/#website\"},\"datePublished\":\"2020-02-22T16:08:07+00:00\",\"dateModified\":\"2026-07-24T13:40:50+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/codesigncert.com\\\/blog\\\/#\\\/schema\\\/person\\\/9af8cbd9dd564d4534f25cd63a48d02d\"},\"description\":\"Learn how to sign JAR files using jarsigner and a Java code signing certificate to pass security checks and remove browser warnings.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/codesigncert.com\\\/blog\\\/how-to-sign-java-files-with-java-code-signing#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/codesigncert.com\\\/blog\\\/how-to-sign-java-files-with-java-code-signing\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/codesigncert.com\\\/blog\\\/how-to-sign-java-files-with-java-code-signing#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/codesigncert.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Sign Java Files with Java Code Signing Certificate &#8211; Quick Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/codesigncert.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/codesigncert.com\\\/blog\\\/\",\"name\":\"CodeSignCert\",\"description\":\"All in One Code Signing Certificate Store\",\"alternateName\":\"Code Sign Cert\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/codesigncert.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/codesigncert.com\\\/blog\\\/#\\\/schema\\\/person\\\/9af8cbd9dd564d4534f25cd63a48d02d\",\"name\":\"Jessica Foster\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/540326c0491587e08522922cbd7c078549e5cafa48300998cdd9613a30e2fec4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/540326c0491587e08522922cbd7c078549e5cafa48300998cdd9613a30e2fec4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/540326c0491587e08522922cbd7c078549e5cafa48300998cdd9613a30e2fec4?s=96&d=mm&r=g\",\"caption\":\"Jessica Foster\"},\"description\":\"Jessica Foster is a contributing writer for the CodeSignCert blog, covering code signing, software security, and certificate management topics. She has 10 years of experience helping developers and businesses secure their software through code signing and related PKI solutions.\",\"sameAs\":[\"https:\\\/\\\/codesigncert.com\"],\"url\":\"https:\\\/\\\/codesigncert.com\\\/blog\\\/author\\\/jessicafoster\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Sign Java Files With a Java Code Signing Certificate","description":"Learn how to sign JAR files using jarsigner and a Java code signing certificate to pass security checks and remove browser warnings.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/codesigncert.com\/blog\/how-to-sign-java-files-with-java-code-signing","og_locale":"en_US","og_type":"article","og_title":"How to Sign Java Files With a Java Code Signing Certificate","og_description":"Learn how to sign JAR files using jarsigner and a Java code signing certificate to pass security checks and remove browser warnings.","og_url":"https:\/\/codesigncert.com\/blog\/how-to-sign-java-files-with-java-code-signing","og_site_name":"CodeSignCert","article_publisher":"https:\/\/www.facebook.com\/codesigncert","article_published_time":"2020-02-22T16:08:07+00:00","article_modified_time":"2026-07-24T13:40:50+00:00","author":"Jessica Foster","twitter_card":"summary_large_image","twitter_creator":"@codesigncert","twitter_site":"@codesigncert","twitter_misc":{"Written by":"Jessica Foster","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/codesigncert.com\/blog\/how-to-sign-java-files-with-java-code-signing#article","isPartOf":{"@id":"https:\/\/codesigncert.com\/blog\/how-to-sign-java-files-with-java-code-signing"},"author":{"name":"Jessica Foster","@id":"https:\/\/codesigncert.com\/blog\/#\/schema\/person\/9af8cbd9dd564d4534f25cd63a48d02d"},"headline":"How to Sign Java Files with Java Code Signing Certificate &#8211; Quick Guide","datePublished":"2020-02-22T16:08:07+00:00","dateModified":"2026-07-24T13:40:50+00:00","mainEntityOfPage":{"@id":"https:\/\/codesigncert.com\/blog\/how-to-sign-java-files-with-java-code-signing"},"wordCount":622,"articleSection":["Code Signing"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/codesigncert.com\/blog\/how-to-sign-java-files-with-java-code-signing","url":"https:\/\/codesigncert.com\/blog\/how-to-sign-java-files-with-java-code-signing","name":"How to Sign Java Files With a Java Code Signing Certificate","isPartOf":{"@id":"https:\/\/codesigncert.com\/blog\/#website"},"datePublished":"2020-02-22T16:08:07+00:00","dateModified":"2026-07-24T13:40:50+00:00","author":{"@id":"https:\/\/codesigncert.com\/blog\/#\/schema\/person\/9af8cbd9dd564d4534f25cd63a48d02d"},"description":"Learn how to sign JAR files using jarsigner and a Java code signing certificate to pass security checks and remove browser warnings.","breadcrumb":{"@id":"https:\/\/codesigncert.com\/blog\/how-to-sign-java-files-with-java-code-signing#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codesigncert.com\/blog\/how-to-sign-java-files-with-java-code-signing"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/codesigncert.com\/blog\/how-to-sign-java-files-with-java-code-signing#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codesigncert.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Sign Java Files with Java Code Signing Certificate &#8211; Quick Guide"}]},{"@type":"WebSite","@id":"https:\/\/codesigncert.com\/blog\/#website","url":"https:\/\/codesigncert.com\/blog\/","name":"CodeSignCert","description":"All in One Code Signing Certificate Store","alternateName":"Code Sign Cert","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codesigncert.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/codesigncert.com\/blog\/#\/schema\/person\/9af8cbd9dd564d4534f25cd63a48d02d","name":"Jessica Foster","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/540326c0491587e08522922cbd7c078549e5cafa48300998cdd9613a30e2fec4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/540326c0491587e08522922cbd7c078549e5cafa48300998cdd9613a30e2fec4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/540326c0491587e08522922cbd7c078549e5cafa48300998cdd9613a30e2fec4?s=96&d=mm&r=g","caption":"Jessica Foster"},"description":"Jessica Foster is a contributing writer for the CodeSignCert blog, covering code signing, software security, and certificate management topics. She has 10 years of experience helping developers and businesses secure their software through code signing and related PKI solutions.","sameAs":["https:\/\/codesigncert.com"],"url":"https:\/\/codesigncert.com\/blog\/author\/jessicafoster"}]}},"_links":{"self":[{"href":"https:\/\/codesigncert.com\/blog\/wp-json\/wp\/v2\/posts\/42","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codesigncert.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codesigncert.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codesigncert.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/codesigncert.com\/blog\/wp-json\/wp\/v2\/comments?post=42"}],"version-history":[{"count":1,"href":"https:\/\/codesigncert.com\/blog\/wp-json\/wp\/v2\/posts\/42\/revisions"}],"predecessor-version":[{"id":75,"href":"https:\/\/codesigncert.com\/blog\/wp-json\/wp\/v2\/posts\/42\/revisions\/75"}],"wp:attachment":[{"href":"https:\/\/codesigncert.com\/blog\/wp-json\/wp\/v2\/media?parent=42"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codesigncert.com\/blog\/wp-json\/wp\/v2\/categories?post=42"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codesigncert.com\/blog\/wp-json\/wp\/v2\/tags?post=42"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}