← 返回命令列表

Linux command

jarsigner 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Sign JAR file

jarsigner -keystore [keystore.jks] [app.jar] [alias]

Verify signature

jarsigner -verify [app.jar]

Verify with details

jarsigner -verify -verbose -certs [app.jar]

Sign APK file

jarsigner -keystore [keystore.jks] -signedjar [signed.apk] [unsigned.apk] [alias]

Sign with specific algorithm

jarsigner -sigalg SHA256withRSA -digestalg SHA-256 [app.jar] [alias]

说明

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.

参数

-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.

FAQ

What is the jarsigner command used for?

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.

How do I run a basic jarsigner example?

Run `jarsigner -keystore [keystore.jks] [app.jar] [alias]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -keystore _file_ do in jarsigner?

Keystore location.