Generate Key And Sign Jar Eclipse

 admin
This class provides the functionality of a secret (symmetric) key generator.
  1. You should load the certificate into the keystore used to generate the CSR with keytool. If your key pair is not already in a keystore (for example, because it has been generated with OpenSSL), you need to use the PKCS12 format to load both key and certificate (see PKCKS12 Keys & Certificates).
  2. Eclipse - Create Jar Files - The Jar File wizard can be used to export the content of a project into a jar file. To bring up the Jar File wizard −.
  3. Sign your app with your key. If you already have an upload key, use it to sign your app. If instead your app is already signed and published to the Google Play store with an existing app signing key, use it to sign your app and make sure to encrypt and export it to opt your app in to app signing by Google Play.

Key generators are constructed using one of the getInstance class methods of this class.

16 rows  Signs project main and attached artifacts using the Eclipse jarsigner webservice. Creating a jar File in Eclipse. This page shows you how to create a jar file (java archive) using the Eclipse IDE. The instructions are for bundling the source code (.java files) into a jar. These instructions do not cover how to make an executable jar. Based on the instructions from the Eclipse documentation.

KeyGenerator objects are reusable, i.e., after a key has been generated, the same KeyGenerator object can be re-used to generate further keys.

There are two ways to generate a key: in an algorithm-independent manner, and in an algorithm-specific manner. The only difference between the two is the initialization of the object:

  • Algorithm-Independent Initialization

    All key generators share the concepts of a keysize and a source of randomness. There is an init method in this KeyGenerator class that takes these two universally shared types of arguments. There is also one that takes just a keysize argument, and uses the SecureRandom implementation of the highest-priority installed provider as the source of randomness (or a system-provided source of randomness if none of the installed providers supply a SecureRandom implementation), and one that takes just a source of randomness.

    Since no other parameters are specified when you call the above algorithm-independent init methods, it is up to the provider what to do about the algorithm-specific parameters (if any) to be associated with each of the keys.

  • Algorithm-Specific Initialization

    For situations where a set of algorithm-specific parameters already exists, there are two init methods that have an AlgorithmParameterSpec argument. One also has a SecureRandom argument, while the other uses the SecureRandom implementation of the highest-priority installed provider as the source of randomness (or a system-provided source of randomness if none of the installed providers supply a SecureRandom implementation).

In case the client does not explicitly initialize the KeyGenerator (via a call to an init method), each provider must supply (and document) a default initialization.

Every implementation of the Java platform is required to support the following standard KeyGenerator algorithms with the keysizes in parentheses:

  • AES (128)
  • DES (56)
  • DESede (168)
  • HmacSHA1
  • HmacSHA256
These algorithms are described in the KeyGenerator section of the Java Cryptography Architecture Standard Algorithm Name Documentation. Consult the release documentation for your implementation to see if any other algorithms are supported.

You use the JAR Signing and Verification Tool to sign JAR files and time stamp the signature. You invoke the JAR Signing and Verification Tool by using the jarsigner command, so we'll refer to it as 'Jarsigner' for short.

To sign a JAR file, you must first have a private key. Private keys and their associated public-key certificates are stored in password-protected databases called keystores. A keystore can hold the keys of many potential signers. Each key in the keystore can be identified by an alias which is typically the name of the signer who owns the key. The key belonging to Rita Jones might have the alias 'rita', for example.

samba mac os x download The basic form of the command for signing a JAR file is

Jar

In this command:

  • jar-file is the pathname of the JAR file that's to be signed.
  • alias is the alias identifying the private key that's to be used to sign the JAR file, and the key's associated certificate.

The Jarsigner tool will prompt you for the passwords for the keystore and alias.

Eclipse Jar File

This basic form of the command assumes that the keystore to be used is in a file named .keystore in your home directory. It will create signature and signature block files with names x.SF and x.DSA respectively, where x is the first eight letters of the alias, all converted to upper case. This basic command will overwrite the original JAR file with the signed JAR file.

In practice, you might want to use one or more of the command options that are available. For example, time stamping the signature is encouraged so that any tool used to deploy your application can verify that the certificate used to sign the JAR file was valid at the time that the file was signed. A warning is issued by the Jarsigner tool if a time stamp is not included.

Options precede the jar-file pathname. The following table describes the options that are available:

Jarsigner Command Options
OptionDescription
-keystoreurlSpecifies a keystore to be used if you don't want to use the .keystore default database.
-sigfilefileSpecifies the base name for the .SF and .DSA files if you don't want the base name to be taken from your alias. file must be composed only of upper case letters (A-Z), numerals (0-9), hyphen (-), and underscore (_).
-signedjarfileSpecifies the name of the signed JAR file to be generated if you don't want the original unsigned file to be overwritten with the signed file.
-tsaurlGenerates a time stamp for the signature using the Time Stamping Authority (TSA) identified by the URL.
-tsacertaliasGenerates a time stamp for the signature using the TSA's public key certificate identified by alias.
-altsignerclassIndicates that an alternative signing mechanism be used to time stamp the signature. The fully-qualified class name identifies the class used.
-altsignerpathclasspathlistProvides the path to the class identified by the altsigner option and any JAR files that the class depends on.

Example

Let's look at a couple of examples of signing a JAR file with the Jarsigner tool. In these examples, we will assume the following:

  • Your alias is 'johndoe'.
  • The keystore you want to use is in a file named 'mykeys' in the current working directory.
  • The TSA that you want to use to time stamp the signature is located at http://tsa.url.example.com.

Generate Key And Sign Jar Eclipse 2017

Under these assumptions, you could use this command to sign a JAR file named app.jar: Reimage pc repair license key generator.

You will be prompted to enter the passwords for both the keystore and your alias. Because this command doesn't make use of the -sigfile option, the .SF and .DSA files it creates would be named JOHNDOE.SF and JOHNDOE.DSA. Because the command doesn't use the -signedjar option, the resulting signed file will overwrite the original version of app.jar.

Let's look at what would happen if you used a different combination of options:

Generate Key And Sign Jar Eclipse Glasses

The signature and signature block files would be named SIG.SF and SIG.DSA, respectively, and the signed JAR file SignedApp.jar would be placed in the current directory. The original unsigned JAR file would remain unchanged. Also, the signature would be time stamped with the TSA's public key certificate identified as testalias.

Additional Information

And

Complete reference pages for the JAR Signing and Verification Tool are on-line: Summary of Security Tools

Generate Key And Sign Jar Eclipse Glasses

Note: When a certificate is self signed, UNKNOWN will be displayed as the publisher of the application. For more information, seeIs it safe to run an application from a publisher that is listed as UNKNOWN?.