7

I used jarsigner to sign my jar file. But I got a warning:

Warning:
This jar contains entries whose signer certificate will expire within six months.

How can I make it never expire or expire in a longer time?

Sawyer
  • 15,581
  • 27
  • 88
  • 124

1 Answers1

7

Specify the required number of days in the -validity parameter to keytool.

Addendum: -validity is an option to keytool.

keytool -genkey -alias sawyer -validity 1234 -dname "…"

After you create the new key, use its unique alias with jarsigner to sign your JAR.

trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • I didn't successfully used -validity option, in my jarsigner command, I cannot see an option parameter called -validity, and also please see here, http://stackoverflow.com/questions/5419425/to-change-jar-expiry-time – Sawyer May 30 '11 at 01:49