LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

jarsigner

signs and verifies Java Archive files

TLDR

Sign JAR file
$ jarsigner -keystore [keystore.jks] [app.jar] [alias]
copy
Verify signature
$ jarsigner -verify [app.jar]
copy
Verify with details
$ jarsigner -verify -verbose -certs [app.jar]
copy
Sign APK file
$ jarsigner -keystore [keystore.jks] -signedjar [signed.apk] [unsigned.apk] [alias]
copy
Sign with specific algorithm
$ jarsigner -sigalg SHA256withRSA -digestalg SHA-256 [app.jar] [alias]
copy

SYNOPSIS

jarsigner [options] jar-file alias

DESCRIPTION

jarsigner signs and verifies Java Archive (JAR) files. It adds digital signatures to ensure authenticity and integrity, required for Java applets, Android apps, and signed JARs.The tool uses certificates stored in keystores for signing. Verification checks that contents haven't been modified and validates the signer's certificate.

PARAMETERS

-keystore file

Keystore location.
-storepass pass
Keystore password.
-keypass pass
Key password.
-signedjar file
Output signed JAR name.
-sigalg algo
Signature algorithm.
-digestalg algo
Digest algorithm.
-verify
Verify signature.
-verbose
Verbose output.
-certs
Show certificates.
-tsa url
Timestamp authority URL.

CAVEATS

Weak algorithms deprecated. Keystores need protection. Timestamp recommended for longevity. Android has specific requirements.

HISTORY

jarsigner has been part of the JDK since Java's early days. JAR signing became important for Java applets in browsers and later for Android application distribution. The tool has evolved to support stronger cryptographic algorithms.

SEE ALSO

keytool(1), jar(1), apksigner(1), openssl(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid