$1 Cheap Domain Names & Easy, Instant, Free Websites!      Cheapest Web Hosting with Unlimited Bandwidth, Websites and Space!
 


 • Cheap Web Hosting       • Dedicated Servers       • Virtual Servers      • WordPress Hosting     • Start a Blog       • Free Phone Support

Make a Website       Free Web Design       Free Domain Name Software       Find Expiring Domains       Reseller Program

  > LOG-IN  <   
 

cheap domain names and web hosting 
 

Frequently Asked Questions

Help Center Search

Sign Java Code

Print this Article
Comment on this Article
Last Updated: September 30, 2008 2:33 PM

Several tools are required to package and sign Java code, including keytool, jar and jarsigner. Beginning with JDK 5.0, jarsigner can generate signatures that include a time stamp, allowing validation that the JAR file was signed while the code signing certificate was still valid.

Approach 1 – Request a New Code Signing Certificate

  1. Download the JDK, if necessary
  2. Request a Code Signing Certificate from Starfield Technologies.
    • Create a new key store. A key store is a place where secure certificates are stored. This example will create a custom key store named "codesignstore" to be used only for a code signing certificate and the associated private key.
      keytool -genkey -alias codesigncert -keypass <yourkeypwd> -keyalg RSA -keysize 2048 -dname "CN=displayname,O=companyname,C=US,ST=state,L=city" -keystore codesignstore -storepass <yourstorepwd>
    • Create a Certificate Signing Request (CSR). A private key will be created and stored in the key store named "codesignstore". A CSR file named "mycsr.pem" will be created in the current working directory.
      keytool -certreq -v -alias codesigncert -file mycsr.pem -keystore codesignstore
    • Purchase a code signing certificate.
    • Click on the purchased code signing certificate credit in “My Account”. This will take you to the GoDaddy/Starfield Secure Certificate Services Account Management web application.The CSR generation method must be set to manual on the request form for the CSR field to be visible.
    • Submit CSR as part of the code signing request.
      • After opening the file “mycsr.pem” in an editor, copy and paste the entire content of the file (including the lines containing “BEGIN NEW CERTIFICATE REQUEST” and “END NEW CERTIFICATE REQUEST”) into the appropriate section of the code signing request form.
    • The company information you have supplied will be verified. The Registration Authority (RA) may contact you to provide additional information, if required.
    • Once the code signing certificate has been issued, you will receive an email message with a link to download the certificate file and any associated intermediate certificates.
  3. Install the code signing certificate, in the same key store created earlier. The following example expects the code signing certificate file to be named “mycert.spc”. The certificate file is expected to be in the current working folder and in PKCS#7 format.
    keytool -import -keystore codesignstore -storepass <yourstorepwd> -alias codesigncert -file mycert.spc
  4. Create a JAR file from Java class files, using the jar tool
    jar cvf myapp.jar myapp.class
  5. Sign the JAR file using jarsigner, using the code signing certificate and the private key
    jarsigner -verbose -keystore codesignstore -storepass <yourstorepwd> -keypass <yourkeypwd> myapp.jar codesigncert
    • ‘codesignstore’ is an alias to the key store where the code signing cert, the private key and all other certificates in the chain are contained.
    • The unsigned input file name is “myapp.jar” and will be overwritten with the signed version of the file. Use the “-signedjar” command line option to specify separate input and output file names.
    • ‘codesigncert’ is an alias to the private key in the key store.
    The following example adds time stamping options to the same example presented above.
    jarsigner -verbose -keystore codesignstore -storepass <yourstorepwd> -keypass <yourkeypwd> -tsa http://tsa.starfieldtech.com/ myapp.jar codesigncert
  6. Verify the signed JAR file
    jarsigner -verify -verbose -certs myapp.jar
  7. Distribute the code

Approach 2 – Use Existing PKCS#12 File, Containing Both Code Signing Certificate and Private Key

  1. Download the JDK, if necessary
  2. Verify that the PFX/P12 file can be used with jarsigner. Execute the following command, the alias name required in step 5 will be displayed near the top of the output:
    keytool -list -storetype pkcs12 -keystore mycert.pfx -v
  3. Create a JAR file from Java class files, using the jar tool:
    jar cvf myapp.jar myapp.class
  4. Sign the JAR file using jarsigner, using the code signing certificate and the private key:
    jarsigner -storetype pkcs12 -keystore mycert.pfx myapp.jar "aliasname"
    • "mycert.pfx" is the full path to the PFX/P12 file containing the code signing certificate and the private key. The file should also include all intermediate certificates.
    • "aliasname" is displayed in the output of step 2, near the top. If the PFX/P12 file was exported from Windows, the alias name will effectively be a GUID.
    • When prompted, enter the password associated with the private key in the PFX/P12 file. You may also include the "-storepass" option to specifiy the password on the command line.
    • The unsigned input file name is "myapp.jar" and will be overwritten with the signed version of the file. Use the "-signedjar" command line option to specify separate input and output file names.
    The following example adds time stamping options to the same example presented above:
    jarsigner -storetype pkcs12 -keystore mycert.pfx -tsa http://tsa.starfieldtech.com/ myapp.jar "aliasname"
  5. Verify the signed JAR file
    jarsigner -verify -verbose -certs myapp.jar
  6. Distribute the code

Links

 


Free USA-Based Technical Support in English, 24 hours a day, 365 days a year:   (480) 624-2500
 
Call us with any question.    Place Orders by Phone.   Our USA-based Help Desk speaks your language.
 

Call Center located in the Phoenix, Arizona, metropolitan area!   Technical Support also available in Spanish.      New to Us?  Get a free account in 60 seconds.
 

.
 Store Home
   |   Shopping Cart   |   Login   |   My Account   |   Frequently Asked Questions   |   Telephone Support   |    Products   |    Free Whois Lookup   |   Legal Agreements
 

Copyright 1994 - 2013 HostingDude Inc.  All Rights Reserved.  No reprint or re-use without written authorization.
Put a Free Domain Name Search Box on your website and look like a real domain pro!    Reciprocal linking is also offered.


**Note that an ICANN registration fee of twenty five (20) cents per domain name, per year, is not shown in the above domain name pricing for .com, .net, .org, .biz, .info, .name, and possibly other TLDs, but must be collected at check-out for domain names registered.  This mandatory fee is charged by ICANN -- the Internet Corporation for Assigned Names and Numbers: www.icann.org and not by HostingDude.com.  Effective November 1, 2004, ICANN requires that HostingDude.com collect this fee and remit the funds to ICANN.  Thus, for example, the fee for a one-year .com registration would be 20 cents, and the fee for a two year registration would be 40 cents (20 cents times 2 years).  Additional years would be at 20 cents per year.  For more information on the levy and purpose of this fee by ICANN, please see this page on the ICANN web site.  All prices shown on this website are subject to change, and some may be introductory in nature with renewal prices at lower or higher rates, as varying with market conditions, and always subject to change until purchased.  In general, your best value is the original purchase prices offered on these pages, particularly for hosting-related services, and thus we strongly encourage customers to purchase at least 12 months of services in advance to lock in our extremely low rates.  *Total number of domain names registered shown above is based on affiliation with W ild Wes t Domains, of which HostingDude.com is one of the largest and fastest growing registration partners, due to our low costs and exceptional service, including free telephone support in an English-speaking (and Spanish-speaking) USA-Based help center.  Please give us a try and begin receiving the great service you've been missing elsewhere.

Cheap Domain Name Registration  |  Cheap Host  |  Domain Name Registration  |  Cheap Hosting  |  Private Domain Registration  |  Cheap Site  |  Transfer Domain Name  |  Cheap Web  |  Bulk Domain Transfer  |  Cheap Web Host  |  Spam-Free Email Accounts  |  Cheap Web Hosting  |  Create Email Account  |  Cheap Web Hosting Account Login  |  Cheap Web Hosting  |  Cheap Web Site  |  Register Domain Name  |  Cheap Web Site Hosting  |  Build a Website  |  Cheap Website  |  Register Domain Names  |  Cheap Website Host  |  Create a Website  |  Cheap Website Hosting  |  Domain Name Forwarding  |  Cheap Websites  |  Online Store with Shopping Cart  |  Cheapest Host  |  Web Hosting  |  Cheap Host  |  Domain Name Masking   |  Lowest Price Hosting  |  fax thru email, fax by e-mail   |  Lowest Price Web Hosting  |  Web Design  |  Cheap Host  |  Free Web Design Tools  |  Lowest Price Website  |  Domain Name Lock  |  Cheapest Hosting  |  Increase Website Traffic  |  Cheapest Site  |  Find a Domain Name    |  Cheapest Web  |  Send Bulk Email  |  Cheapest Web Host  |  Copyright Protection  |  Cheapest Web Hosting  |  Stop Complaint Sites & Gripe Sites  |  Cheapest Web Site  |  Block Internet Gripe Sites  |  Cheapest Web Site Hosting  |  Register Copyright  |  Cheapest Web Sites  |  Domain Backorder  |  Cheapest Website  |  Backorder Domain Name  |  Cheap Website Host  |  Expired Domain Name  |  Cheapest Website Hosting  |  Make a Website  |  Cheapest Websites  |  Free Domain Name  |  Lowest Price Website Hosting  |  Free Domain Name Software  |  Lowest Price Websites  |  Secure SSL Certificate  |  Lowest Cost Host  |  Send Bulk Email  |  Lowest Cost Hosting  |  PayPal Domain Names and Hosting  |  Lowest Cost Web Hosting  |  Build an Online Store with Shopping Cart  |  Lowest Cost Web Site  |  Accept Credit Cards  |  Lowest Cost Websites  |  eCommerce Shopping Cart Site   |  Lowest Cost Website  |  fax through email, fax via email   |  Help Center

 Index  A  B Back  C Cheap  D Domain Direct Domains Domains Domain  E Expiring Expried  F Free Free Domain Name  G 
H Hosting Host IP
 I  J  K  L  M  N  O  P  Q  R Registered  S Sights  T  U  V  W Web Wh  X  Y  Z  Symbol  Numeric  Site Map

cheap music  |  Silversea cruises  |  cheap DVDs  |  free domain name  |  Regent Seven Seas Cruises  |  cheap movies  |  register domain name  |  Seabourn cruises  |  cheap domain names  |  Queen Mary 2 cruises  |  cheap videos  |  Sea Dream cruises  |  cheap books  |  luxury cruises  |  cheap CDs  |  deluxe cruises  |  cheap movies  |  cheap web hosting  |  Cunard Cruises  |  cheap films  |  domain name registration  |  cheap songs  |  domain name intelligence