Android platform signed certificate (.keystore) generated Guide

Source: https: //ask.dcloud.net.cn/article/35777

Android platform signed certificate (.keystore) generated Guide

Category: HTML5 +

Android apk publishing platform packaged applications, require the use of digital certificates (.keystore file) sign, indicating the identity of the developer, you can use JRE environment keytool command generates.
Here's how to generate a certificate of windows platform:

Install the JRE

Jre from Oracle official download the installation package:: https //www.oracle.com/technetwork/java/javase/downloads/index.html
as: "\ Program Files \ Java \ jre1.8.0_201 C" below to install directory Example
recommended installation path JRE added to the system environment variable, skip this section configured
to open the command (cmd), enter the following:

Copy the coded:  
set PATH=%PATH%;"C:\Program Files\Java\jre1.8.0_201\bin"  
  • First line: switching the working directory to D: Path
  • The second line: jre command to add a temporary environment variable

Generating a signature certificate

Use keytool -genkey command to generate certificate:

Copy the codekeytool -genkey -alias testalias -keyalg RSA -keysize 2048 -validity 36500 -keystore test.keystore  
  • testalias certificate is an alias, you can modify the character they want to set, we recommend using English letters and numbers
  • test.keystore is the certificate file name, you can modify the file name you want to set for themselves

After the carriage return will prompt:

Copy the codeEnter keystore password:  //输入证书文件密码,输入完成回车  
Re-enter new password:   //再次输入证书文件密码,输入完成回车  
What is your first and last name?  
  [Unknown]: //输入名字和姓氏,输入完成回车 What is the name of your organizational unit? [Unknown]: //输入组织单位名称,输入完成回车 What is the name of your organization? [Unknown]: //输入组织名称,输入完成回车 What is the name of your City or Locality? [Unknown]: //输入城市或区域名称,输入完成回车 What is the name of your State or Province? [Unknown]: //输入省/市/自治区名称,输入完成回车 What is the two-letter country code for this unit? [Unknown]: //输入国家/地区代号(两个字母),中国为CN,输入完成回车 Is CN=XX, OU=XX, O=XX, L=XX, ST=XX, C=XX correct? [no]: //确认上面输入的内容是否正确,输入y,回车 Enter key password for <testalias> (RETURN if same as keystore password): //确认证书密码与证书文件密码一样(HBuilder|HBuilderX要求这两个密码一致),直接回车就可以 

The above command will generate a certificate after the run is completed, the path is "D: \ test.keystore".

You can use the following command to view the certificate information:

Copy the codekeytool -list -v -keystore test.keystore  
Enter keystore password: //输入密码,回车  

Guess you like

Origin www.cnblogs.com/zouhao/p/11094871.html