Niente!
Ho provato, riprovato, googlato e rigooglato, letto decine e decine di POST ma non sono riuscito ad andare avanti.
Il link dice di fare così
Signing JAR Files with a Test Certificate
Here are the steps needed to sign a JAR file with a test certificate:
1. Make sure that you have a JDK 1.2 or JDK 1.3 keytool and jarsigner in your path (located in the J2SE SDK bin directory).
2. Create a new key in a new keystore as follows:
keytool -genkey -keystore myKeystore -alias myself
You will get prompted for a information about the new key, such as password, name, etc. This will create the myKeystore file on disk.
3. Then, create a self-signed test certificate as follows:
keytool -selfcert -alias myself -keystore myKeystore
This will prompt for the password. Generating the certificate takes a few minutes.
4. Check to make sure that everything is ok. To list the contents of the keystore, use the command:
keytool -list -keystore myKeystore
It should list something like:
Keystore type: jks
Keystore provider: SUN
Your keystore contains 1 entry:
myself, Tue Jan 23 19:29:32 PST 2001, keyEntry,
Certificate fingerprint (MD5):
C2:E9:BF:F9:D3:DF:4C:8F:3C:5F:22:9E:AF:0B:42:9D
5. Finally, sign the JAR file with the test certificate as follows:
jarsigner -keystore myKeystore test.jar myself
Repeat this step on all of your JAR files.
Please note that a self-signed test certificate should only be used for internal testing, since it does not provide any guarantees about the identity of the user and therefore cannot be trusted. A trust-worthy certificate can be obtained from a certificate authority, such as VeriSign, and should be used when the application is put into production.
ma ovviamente non mi funziona.
Ho un errore di
keytool error: java.lang.IllegalStateException: not encrypted dopo la certificazione.
Codice: Seleziona tutto
daemon_nio@matrix:~/keytool$ keytool -genkey -keystore myKeystore -alias myself
Enter key store password: pass
Enter key password for <myself>: mypass
You are about to enter information that will be incorporated into
your certificate request. This information is what is called a
Distinguished Name or DN. There are quite a few fields but you
can use supplied default values, displayed between brackets, by just
hitting <Enter>, or blank the field by entering the <.> character
before hitting <Enter>.
Common Name (hostname, IP, or your name): host.org
Organization Name (company) [The Sample Company]: a
Organizational Unit Name (department, division): b
Locality Name (city, district) [Sydney]: c
State or Province Name (full name) [NSW]: d
Country Name (2 letter code) [AU]: IT
daemon_nio@matrix:~/keytool$ keytool -selfcert -alias myself -keystore myKeystore
Enter key store password: pass
Enter key password for <myself>: mypass
keytool error: java.lang.IllegalStateException: not encrypted
daemon_nio@matrix:~/keytool$
però alla generazione delle chiavi non c'è errore infatti mostrandola l'ha creata:
Codice: Seleziona tutto
aemon_nio@matrix:~/keytool$ keytool -genkey -keystore myKeystore -alias myself
Enter key store password: pass
Enter key password for <myself>: mypass
You are about to enter information that will be incorporated into
your certificate request. This information is what is called a
Distinguished Name or DN. There are quite a few fields but you
can use supplied default values, displayed between brackets, by just
hitting <Enter>, or blank the field by entering the <.> character
before hitting <Enter>.
Common Name (hostname, IP, or your name): host.org
Organization Name (company) [The Sample Company]: a
Organizational Unit Name (department, division): b
Locality Name (city, district) [Sydney]: c
State or Province Name (full name) [NSW]: d
Country Name (2 letter code) [AU]: IT
daemon_nio@matrix:~/keytool$ keytool -list -keystore myKeystore
Enter key store password: pass
Key store type: gkr
Key store provider: GNU-CRYPTO
Key store contains 1 entry(ies)
Alias name: myself
Creation timestamp: giovedì ottobre 9, 2008 AD - 10:45:24;801 o'clock GMT+02:00
Entry type: key-entry
Certificate fingerprint (MD5): 91:03:C7:E8:E6:AB:C0:2A:10:38:56:24:55:49:3D:35
ma ovviamente poi il jar non lo firma... non ho certificato le chiavi:
Codice: Seleziona tutto
daemon_nio@matrix:~/keytool$ jarsigner -keystore myKeystore ../Desktop/PhotoReadyClientInstaller.jar myself
Enter Passphrase for keystore: pass
jarsigner error: java.lang.RuntimeException: keystore load: Invalid keystore format
Avete mai provato a certificare un Jar?