Sign: Writes specific tag information to a specific field in the application, indicating that the software has passed the signer's approval. Procedure: Digitally sign a given application with a private key
Role:
Identify application Authors
Detects if the application has changed
There is a kind of program upgrade. When the new program is inconsistent with the old program's signature, conflicts do not feel the same app, requiring new programs to change the package name
。
。。
Keytool generating the Signature private key command
Keytool-genkey-v-keyalg dsa-keysize 1024-sigalg sha1withdsa-validity 10000-keystore test.keystore-alias devel -keypass 123456-storepass 123456
Number of references:
| Keytool Options |
Descriptive narrative |
-genkey |
Produces a key-value pair (public and private) |
-v |
Agree to action output |
-alias<alias_name> |
The alias of the key.
Only the first eight characters are valid. |
-keyalg |
The encryption algorithm that generates the key. Supports DSA and RSA. |
-keysize |
Produces the length of the key. Assuming not supported, Keytool uses the default value of bits. Usually we use 2048 bits or longer keys.
|
-dname |
The distinguished name. Describes who created the key.
This value is used as the issuer and subject field of the self-signed certificate. Note that you can not specify at the command line. Assuming that no specified Keytool will prompt you (CN, OU, and so on).
|
-keypass |
The password of the key.
Primarily for safety reasons, assumptions are not provided. Keytool will prompt you for input.
|
-validity |
Key expiration date, Unit: Day
Note: A value of 10000 or greater is recommended. |
-keystore.keystore |
The file used to store the private key.
|
-storepass |
The password of the private key store file.
Primarily for safety reasons, assumptions are not provided. Keytool will prompt you for input.
This password is not stored in your shell history.
|
Jarsigner signing with a private key
Jarsigner-verbose-sigalg sha1withdsa-digestalg sha1-keystore test.keystore-storepass 123456 test.apk devel
Number of references:
| Jarsigner Options |
Descriptive narrative |
-keystore.keystore |
The storage file that includes your private key |
-verbose |
Displays the output action. |
-sigalg |
Signature algorithm, with SHA1withRSA . |
-digestalg |
The Message digest algorithm. Use SHA1 . |
-storepass |
Stores the password of the file.
Primarily for safety reasons, assumptions are not provided. Jarsigner will prompt you for input. This password is not stored in your shell history. |
-keypass |
The password of the private key.
Mainly for safety reasons. If not provided, Jarsigner will prompt you for input.
This password is not stored in your shell history. |
Why the app is signed, signed with Keytool Jarsigner