LinuxCommandLibrary

jarsigner

Sign and verify Java Archive (JAR) files.

TLDR

Sign a JAR file

$ jarsigner [path/to/file.jar] [keystore_alias]
copy


Sign a JAR file with a specific algorithm
$ jarsigner -sigalg [algorithm] [path/to/file.jar] [keystore_alias]
copy


Verify the signature of a JAR file
$ jarsigner -verify [path/to/file.jar]
copy

Help

Usage: jarsigner [options] jar-file alias 
       jarsigner -verify [options] jar-file [alias...] 

[-keystore ]           keystore location 

[-storepass ]     password for keystore integrity 

[-storetype ]         keystore type 

[-keypass ]       password for private key (if different) 

[-certchain ]         name of alternative certchain file 

[-sigfile ]           name of .SF/.DSA file 

[-signedjar ]         name of signed JAR file 

[-digestalg ]    name of digest algorithm 

[-sigalg ]       name of signature algorithm 

[-verify]                   verify a signed JAR file 

[-verbose[:suboptions]]     verbose output when signing/verifying. 
                            suboptions can be all, grouped or summary 

[-certs]                    display certificates when verbose and verifying 

[-tsa ]                location of the Timestamping Authority 

[-tsacert ]          public key certificate for Timestamping Authority 

[-tsapolicyid ]        TSAPolicyID for Timestamping Authority 

[-tsadigestalg ] algorithm of digest data in timestamping request 

[-altsigner ]        class name of an alternative signing mechanism 
                            (This option has been deprecated.) 

[-altsignerpath ] location of an alternative signing mechanism 
                            (This option has been deprecated.) 

[-internalsf]               include the .SF file inside the signature block 

[-sectionsonly]             don't compute hash of entire manifest 

[-protected]                keystore has protected authentication path 

[-providerName ]      provider name 

[-addprovider         add security provider by name (e.g. SunPKCS11) 
  [-providerArg ]] ... configure argument for -addprovider 

[-providerClass      add security provider by fully-qualified class name 
  [-providerArg ]] ... configure argument for -providerClass 

[-strict]                   treat warnings as errors 

[-conf ]               specify a pre-configured options file 

[-? -h --help]              Print this help message 

Copied to clipboard