我的问题的根本原因:由于Google Play
需要证书在之后过期October 22, 2033
,我已将系统日期更改为提前日期。
证书助手有效期的有效值为Keychain Access
20年,所以如果我创建一个新证书,它将在2033年6月26日到期,未能达到要求。
A validity period for an X509 certificate is the number of days the certificate
is valid from the time it is issued. Certificates issued by Certificate Assistant
have a maximum validity period of 20 years.
使用此证书对我的空中应用程序进行代码签名时,Google Play 在上传 apk 时提示错误
Upload failed
You uploaded an APK signed with a certificate that is not yet valid.
You need to sign your APK with a certificate that is currently valid.
了解有关签名的更多信息。
keytool
所以我通过执行以下命令创建了一个新证书:
$ keytool -keystore cert.jks -genkeypair -alias cert -keyalg RSA -keysize 2048 \
-validity 18250 -dname 'CN=cert,OU=org,O=org,L=location,ST=state,C=PH'
$ keytool -keystore cert.jks -exportcert -alias cert \
| openssl x509 -inform der -text
$ keytool -importkeystore -srckeystore cert.jks -destkeystore cert.p12 \
-srcstoretype jks -deststoretype pkcs12