手动创建 keystore 文件
用 命令行方式 创建 .keystore 文件
使用 keytool 工具(Java 自带)
第一步:检查是否安装 Java
- 打开终端(CMD / PowerShell / Terminal)
-
java -version - 如果提示找不到,需要先安装 JDK(https://www.oracle.com/java/technologies/downloads/)
第二步:生成 keystore
运行以下命令(替换为你自己的信息):
keytool -genkey -alias myapp -keyalg RSA -keysize 2048 -validity 36500 -keystore myapp.keystore
⚠️ 注意:
-alias myapp:证书别名(记住它!)-keystore myapp.keystore:输出文件名-validity 36500:有效期 100 年(可选)系统会提示你输入密码和一些信息:
Enter keystore password: 123456 Re-enter new password: 123456 What is your first and last name? My Name What is the name of your organizational unit? Dev Team What is the name of your organization? My Company What is the name of your City or Locality? Beijing What is the name of your State or Province? Beijing What is the two-letter country code for this unit? CN✅ 成功后会在当前目录生成一个
myapp.keystore文件。文件一般默认存放在-
C:\Users\Lenovo>
4323

被折叠的 条评论
为什么被折叠?



