Skip to main content

Problem Signing midlet .jar file.

2 replies [Last post]
namit_232
Offline
Joined: 2007-09-14
Points: 0

Hi, I am facing problem in signing midlets. I have a certificate (.cer)from Verisign which i imported to a keystore and then signed the jar file.

The jar is signed but it gives message that the certificate wil expire in six months despite our certificate has the validity till 2011. Also when the application is installed in mobile it appears as invalid application. The steps which I performed are below.

step -1 : Created a keystore in d:/
------------------------------------
keytool -genkey -alias -keystore d:/myStore.ks -keyalg RSA.

THE KEYSTORE CREATED SUCCESSFULLY.

step -2 : importing the certificate in keystore
------------------------------------------------
keytool -import -keystore d:/myStore.ks -file Certificate.cer.

THE CERTIFICATE IMPORTED TO THE KEYSTORE.

Step -3 : Problem occurs in signing the jar.
jarsigner Abc.jar

THE JAR FILE IS SIGNED BUT IT SHOWS THE CERTIFICATE VALIDITY OF SIX MONTHS AND APPEARS AS AN INVALID APP. WHEN INSTALLED IN MOBILE..

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
artem_kustikov
Offline
Joined: 2008-08-28
Points: 0

It seems to me that there is some inconsistency in certificate request/import sequence.
I did it in following way:
1. ...\keytool.exe -genkey -validity 1800 -keyalg rsa -keystore [b]-alias applet_signing[/b]
2. ...\keytool.exe" -importcert -trustcacerts -keystore -storepass
[b]-alias applet_signing[/b] -file cert.cer

See that I have used the same alias while importing certificate.
To sign applet I use following command line:
...\jarsigner.exe -storepass
-keystore applet.jar [b]applet_signing[/b]

It works fine for me - all certificate info loaded correctly (expiration date, issuer...).

Try to import your certificate using correct alias and keystore, also you can verify certificate import correctness by following command:
...\keytool.exe -list -v -keystore -storepass
[b]-alias applet_signing[/b]

namit_232
Offline
Joined: 2007-09-14
Points: 0

Hi,
Firstly thanks for your reply. But when I follow your steps there is no real difference in the output. It still shows "Six months left"

And I have a midlet .jar file which I want to sign.

For midlet, is there anything special to be done??

And very important... in my post i have mentioned that my certificate is from verisign... but its actually comodo certificate. So now... could you tell me what wrong I have done.

Regards
Namit.