preface
The company H5 colleagues package APK needs the native Android. keystore signature in this record the implementation process and method
The Android platform packages and distributes APK applications, which need to be signed with a digital certificate (.keystore file) to identify the developer.
Android certificate generation is self-service and free, and does not require approval or payment.
You can run the keytool command in the JRE environment. The following is how the Windows platform generates a certificate:
Install the JRE environment (JRE8 is recommended, and can be skipped if it already exists).
You can download the JRE installation package from the official Oracle database: You can download the JRE installation package from the official Oracle Database. In this example, change the installation directory C:\Program Files\Java\jre1.8.0_201 to your own installation directory
You are advised to add the JRE installation path to the system environment variable. If the JRE installation path has been configured, skip this section
Open the command line (CMD) and enter the following command:
d: set PATH=%PATH%; “C: \ Program Files \ Java \ jre1.8.0 _201 \ bin”
- Line 1: Switch the working directory to the D: path
- Line 2: Add the JRE command to the temporary environment variable
Generating a Signing Certificate
Run the keytool -genkey command to generate a certificate.
keytool -genkey -alias testalias -keyalg RSA -keysize 2048 -validity 36500 -keystore test.keystore
- The testAlias is the certificate alias. You can set the testAlias to the character you want. You are advised to use letters and digits
- Test. keystore is the name of the certificate file. You can change it to the desired file name or specify the full file path
- Genkey generates files
- Keyalg encryption algorithm
- The validity of the gnosis.xml.validity
Press Enter to prompt:
Enter keystore password: // Enter the certificate file password and press re-enter new password: // Enter the certificate file password again and press Enter. What is your first and last name? [Unknown]: // Enter your name and surname and press Enter What is the name of your organizational unit? [Unknown]: // Enter the name of your organization and press Enter. [Unknown]: // Enter the name of the organization and press Enter What is the name of your City or Locality? [Unknown]: // Enter the name of your city or region and press Enter. [Unknown]: // Enter the name of province/city/autonomous region and press Enter What is the two-letter country code for this unit? [Unknown]: // Enter the country/region code (two letters), China Is CN, enter Is CN=XX, OU=XX, O=XX, L=XX, ST=XX, C=XX correct? [no]: // Verify that the previous input is correct, type y, press Enter key password for < testAlias > (RETURN if same as keystore password): / / and the certificate file confirmation certificate passwords are the same (HBuilder | HBuilderX requirements) the two codes / / return can directlyCopy the code
After the above command is executed, the certificate will be generated in the path “C:\Program Files\Java\jre1.8.0_201\bin”.
Viewing Certificate Information
You can run the following command to view the information:
Keytool -list -v -keystore test.keystore Enter keystore password: // Enter the password and press Enter
Output information in the following format:
Keystore type: PKCS12
Keystore provider: SUN
Your keystore contains 1 entry
Alias name: test
Creation date: 2019-10-28
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=Tester, OU=Test, O=Test, L=HD, ST=BJ, C=CN
Issuer: CN=Tester, OU=Test, O=Test, L=HD, ST=BJ, C=CN
Serial number: 7dd12840
Valid from: Fri Jul 26 20:52:56 CST 2019 until: Sun Jul 02 20:52:56 CST 2119
Certificate fingerprints:
MD5: F9:F6:C8:1F:DB:AB:50:14:7D:6F:2C:4F:CE:E6:0A:A5
SHA1: BB:AC:E2:2F:97:3B:18:02:E7:D6:69:A3:7A:28:EF:D2:3F:A3:68:E7
SHA256: 24:11:7D:E7:36:12:BC:FE:AF:2A:6A:24:BD:04:4F:2E:33:E5:2D:41:96:5F:50:4D:74:17:7F:4F:E2:55:EB:26
Signature algorithm name: SHA256withRSA
Subject Public Key Algorithm: 2048-bit RSA key
Version: 3
Copy the code
Including Certificate fingerprint information:
- MD5 Fingerprint information of the MD5 certificate (security code MD5)
- SHA1 Fingerprint of the certificate (security code SHA1)
- SHA256 Fingerprint of the certificate (security code SHA245)
Share with you
I want to work my way up
Fly forward on the blades at the highest point
Let the wind blow dry tears and sweat
I want to work my way up
Waiting for the sun to watch its face
Little days have big dreams
I have my day
Let the wind blow dry tears and sweat
One day I will have my day